Active
Project:
XSPF Playlist
Version:
5.x-0.5
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2007 at 05:18 UTC
Updated:
12 Apr 2008 at 21:50 UTC
Your module is essential! Thank you for all the great work...
i'm a bit of a newbie, though, and can't find any instructions on how to implement XSP Playlist. Your readme file advises:
"You can generate a xspf playlist for a node by using the url:
http//mysite.com/xspf/node/NID
where NID is the node id of the node that you want the playlist for."
...but i don't know where to insert my node id address in your module. Any directions, no matter how brief, would be greatly appreciated. Thanks...
Comments
Comment #1
arthurf commentedHuh, I guess my intuitive directions are not so intuitive :)
The idea is the following: you have http://mysite.com/node/33. You've attached a few mp3 and flv files to node/33 via the upload module. If you've got your xspf_playlist settings right, if you goto http://mysite.com/xspf/node/33 you will generate a xspf play list from the attachments on that node.
What you need to do now is feed the url (http://mysite.com/xspf/node/33) to your flash player. You can do this in node.tpl.php. I generally use the swfobject_api module to generate the code for my flash player. So for example, I might have this code in my node.tpl.php
This code assumes you have your media player stored in a directory called "flash" in your current theme directory.
Comment #2
ctmann commentedThanks for the help. it works! Here's what i did:
-checked XSPF Playlist Permissions
-Admin/Settings/XSPF Playlist Settings/Playlist enabled
--Audio, Page, Story (other types of content freak out my system)
--Checkmarked everything else on the page (Use attached files for playlist)
-created new node, uploaded files to the node (as instructed)
--(file by file takes a LONG time. Any way to bulk upload with your module?)
- figure out the new node's number, then go to it's address at "http://www.mysite/xspf/node/NodeNumberGoesHere" This creates a new XML playlist.
< The xml file is created at files/playlists. My playlists have bizarre numerical names, so they're hard to tell apart.>
I use jeroen wijering's player for this next part, and I go to this page for the code:
http://www.jeroenwijering.com/extras/wizard.html
fill in the file to play:
fill in the location of the player:
click "Reload the player" and copy the code which appears into the new node's block body. The "full html" radio button must be selected.
*For some reason, the wijering wizard likes to add "public_html" to addresses I enter, so it's worth double checking the names of the files once I've pasted the code.
Seems to work well for me. I appreciate the prompt help and the great module!
Comment #3
arthurf commentedHi-
File uploads are controlled by Drupal core, so no, unfortunately, you have to upload your files which is dependent on your upstream speed. For many people this can be quite slow.
Good luck with your media!
Comment #4
butler commentedHi. Installing XSPF Playlist under Drupal 5.2, I find there is a required module:
Depends on: Content (missing)
... of which I can't find any mention anywhere. I can't enable the XSPF Playlist module so it must really be required but I am wondering whether it is part of something else (CCK?), maybe a typo of the module Contento (apparently obviated in Drupal 5?), or... what? Please advise. Thanks very much for all your efforts.
Best,
CDB
Comment #5
aperj commentedHello,
I was able to get everything to work by following the instructions (enabling the modules, attaching mp3 files, etc).
The only thing it's not doing is creating the xml file at /files/playlists. When I browse to the url "/xspf/node/nid" I get the xml data with all tracks but the file is never created.
Any ideas why this is? Could it be a permissions issue?
Comment #6
arthurf commentedHi- The idea behind the xspf playlist is that it is dynamic- as people add or change content on a given node, it changes the content that is available via the playlist. It could be possible to actually write the file to reduce the overhead, but I haven't gotten there yet. Something could be done that is quite similar to imagecache....
Comment #7
aperj commentedHello!
Thanks for your quick response. I have found a workaround by placing the following code in my template file for the node. I'm using the contemplate module and added this code to write the file before displaying the node:
I then use this to display the player:
This will allow me to upload my files to the node and have them automatically appear in the player when viewing the node. I'm not sure how much of a hack this is but so far it's working for me.
Thanks for all of your help!!
Comment #8
arthurf commentedI'm not sure that this is really necessary. Where you do this:
Would be the same as:
Unless you're trying to save hits on apache, I'm note sure why you'd write the file. I think there is an argument for caching and even writing the xml files for performance, but I haven't quite figured out how to keep these files fresh yet if dynamic data is a concern (which I think it is).
Anyway, I'm glad your hack works- and I'd love to understand why you need it- I'd like to make this module as useful as possible.
Comment #9
aperj commentedYou are right about my not needing to write the file. I initially tried providing the xspf URL inside the "file=" argument but it wasn't working (not sure why). Now it works as you've described.
I'm building a dynamic audio player with playlists, I expect this is fairly normal usage of this module. Each song in the playlist needs to have it's own image. I'm just getting started and perhaps I'm not doing this properly, but what I've done is create a CCK type called 'playlist' and configured the xspf module to treat attached audio files as playlist items. I then use the above code to display the player along with the playlist items.
At this point when I display the player and list, each song uses the same image as well as the same title. Inside the function "xspf_playlist_create_file_item($node, $file)" within the xspf module I made this change:
From:
$item['title'] = $node->title;to :
$item['title'] = $file->filename;BTW, I'm not going to leave this change there -- will find a different place for it that doesn't interfere with your module.
This uses the file's title to display for the play list rather then the title of my CCK node. I'm really unsure at this point how to get a thumbnail for each song. The xml field I'm trying to populate is "". If I add an image field to my CCK type and configure the xspf module to use this field, it uses the same image for all of my songs. It seems like I need a way to upload an image along with my audio file. I'm thinking about using the audio module but I'd like to use something simpler at this point.
Do you have any ideas for what I can do to get the thumbnail per song?
Comment #10
aperj commentedThe only things I can think of are:
a.) Use the Audio module to upload the songs. This module provides for using an image per audio module. I will then need to figure out how to attach the audio .mp3 file to the playlist node (perhaps I can do this programatically). I can then get the song thumbnail for the audio file. This seems like alot of work.
b.) Perhaps the GetID3() library can help if a thumbnail image is stored as part of the mp3 file?
c.) Modify my cck creation form to allow the user to upload an image along with the mp3 file. This also sounds like a lot of work since it will involve mucking around with the upload module
d.) I will also look at the version 4 playlist module to see if it can help me figure out the best approach
Comment #11
arthurf commentedIf you wanted to generate your own playlist structure, it's pretty straight forward- you can use a hook which alerts xspf_playlist that you have your own way of generating your playlist:
There is another example in the xspf_playlist module- look at xspf_playlist_xspf_playlist_use() to see how it implements this hook.
I think I could build an mp3 style playlist into the module as an option- if you can give me some pointers on how it should be done (heck, we could even try to look up album images on amazon) I'm all ears. I also gladly accept patches.
Comment #12
(not verified) commentedComment #13
headkit commentednice moduel! thanx for sharing.
would it be easy to implement the possibility to use also files attached to a node by the mediafield.module?
Comment #14
xcusso@drupal.cat commentedXspf module works under views?
For example http://www.myhomepage.com/xspf/viewname
Thanks.
Comment #15
Songstress commentedDid anyone ever answer this for butler? I've run into the same issue -- someone point me to the "Content" module so I can install it! :)
Comment #16
arthurf commentedContent = cck See: http://drupal.org/project/cck
Comment #17
arthurf commentedYes, this does do some integration with views. You'll need to make sure the content types are right for what is being passed via the view, but it does work
Comment #18
kulfi commentedanother request for documentation
Comment #19
arthurf commentedulfk-
I'd love help getting documentation together. I've done a lot of work trying to get these modules out into the world, now I need some help from people using (or trying to use) them to write good documentation.
What do you need documentation for? What it seems unclear to you? I just added some information to the readme:
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/xspf_playli...
Comment #20
gusaus commentedAgreed this module (or interaction between modules) could benefit from some more documentation, examples, case studies, etc. We're building a band site and would love to provide a real world example for 'how to' use these modules -- ideally we can give back the entire site in the form of a band site profile.
Would XSPF Playlist module and a combo of 'x, y, z' produce something like these?
* http://petergabriel.com/discography/release/Hit/259/ - click on the listen link and the track player comes up - can we do that w/ xspf and audio module? emfield? media field? all of the above?
* http://jacksonbrowne.com/discography/albums/5251.aspx - similar deal when you click on a track...
Would be great to provide a real world case study of the various tools that Drupal offers to provide this type of functionality.
Comment #21
aterchin commentedfor starters, all i'd like to do is add something to the code that looks at a cck node finds an image in a specific field, and adds a
<image=http://....>in the playlist to the flv file i've uploaded (for this specific cck content type/playlist entry)What i think is causing a bit of confusion with some people is where to put the hooks and functions examples in the readme. And 'this notifies XSPF that your module...' etc.
Is this to insert in template.php? Or do you literally mean create a new module with a folder, info file, etc.. this seems to relate to what's in the flvmediaplayer settings--you've got the Media File drop-down that says 'select a module to load the media for this player...' Does this mean we could make some more like the examples in the xspf readme (automatically added to the drop down list)? if so, very cool. but again, i'm not sure where to add the code. or i could be way off here.
(Using 5.x-0.12)