Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I have configured Audiofield to use the XSPF Slim Player. It displays the player, but when you click on the play button, it shows a playlist of one that reads:
1. undefined
Is there a way to get the Description field to appear in the playlist?
Drupal 6.20
audiofield-6.x-1.0
cck-6.x-2.9
contemplate-6.x-1.2
filefield-6.x-3.9
image-6.x-1.1
imageapi-6.x-1.9
imagecache-6.x-2.0-beta10
imagefield-6.x-3.9
thickbox-6.x-1.6
views-6.x-2.12
Comment | File | Size | Author |
---|---|---|---|
#1 | xspf_player.jpg | 1.55 KB | stanb |
Comments
Comment #1
stanb CreditAttribution: stanb commentedHere's a screen capture of the problem:
Comment #2
plastikkposen CreditAttribution: plastikkposen commentedHi.
Could be the directory your files are located:
Fromt the readme.txt:
"Finally you have to put any mp3 audio file at "\sites\all\libraries\player\"
and you have to name it as Sample_Track.mp3, this step just to gives the ability
to test all audio players before you choose your default audio player"
However you can change the default directory in the audiofile.module file. Search for this line:
'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player')
You might "need" the pathauto module and the filepathauto module to get the uploaded files to the right directory.
Comment #3
stanb CreditAttribution: stanb commentedplastikkposen, thanks for your reply. Yes, I see now the part about sample_track.mp3 but that appears to be there for testing, although I don't see how it is a test. Why would you need to manually upload a sample file here? The point of the module (I thought but perhaps I am wrong) is to allow one to browse a local machine and upload a file using the Upload Widget that is specified as a CCK field after creating a content type for this purpose.
I looked at audiofield.module and 'path' => variable_get('audiofield_players_dir', 'sites/all/libraries/player') actually looks like the path to the player not to the mp3 file.
The installation instructions (http://drupal.org/node/973194) read:
So, here's what I did. I created a content type called Audio Gallery and created a new field called Audio with Widget Type = Audio Upload for the Audio Gallery content type.
The default upload path for uploaded files is "sites/default/files", so when I create an Audio Gallery content type, it allows me to browse my local machine, select a file, and upload it. I have limited control over which directory the file gets uploaded to. I can specify a path beneath "sites/default/files" by configuring the field Path Settings in the Audio Gallery Content Type but that's as much control as I have.
I don't understand why a sample file must be uploaded to "\sites\all\libraries\player\" since:
1. this is the location of the player not the mp3 source files
2. the path is determined by the Audio Upload field in the CCK after AudioField is installed not a path of my choosing.
If you think there maybe something wrong with the way I have configured the content type or installed the module, please let me know. Thanks.
Comment #4
tamerzg CreditAttribution: tamerzg commentedsample_track.mp3 is optional mp3 to test players at admin configuration page (admin/config/audiofield). It doesn't have anything to do with uploading other files via cck field. The way you did is correct. Mp3 filename should show in a player, not description. Since each player has its own theming function you can try to override that and adjust player parameters per your needs.
Comment #5
stanb CreditAttribution: stanb commentedtamerzg, thank you for replying. I understand the function of the sample_track.mp3 file now. Unfortunately, when I go to AudioField under Site Configuration and try to play the sampe file, it does not play. The WP Player reads "Connecting..." and spins its wheels. The XSPF Player does nothing.
My issue with the playlist being undefined though is now resolved BUT ONLY when using the WP Player. In order to get a description in the playlist I had to enter a Title for the mp3 file, i.e., right click on the filename, go to Properties -> Summary, enter a title and save the file. Then when I upload it, the Title appears in the playlist.
The XSPF Music Player still does not display a playlist. I even tried clearing the cache but that did not help either.
I guess I will try to theme the WP Player to suit the look of my site. I see that the player theme is defined in the audiofield.module with the Callback function here:
But I have no idea of where to begin to override/utilize this function. Can you point me in the right direction? Is there documentation I can read about using callback functions? I would like to have this function applied to all pages of a specific content type. Thanks for any help.
Comment #6
tamerzg CreditAttribution: tamerzg commentedYou can copy that function to your theme template.php file and rename it to phptemplate_audiofield_players_wpaudioplayer
After that clear the cache and it should work.
Comment #7
stanb CreditAttribution: stanb commentedI'm using the Zen theme with a sub theme that I created in sites/all/themes/subzen. Will renaming the function to phptemplate_audiofield_players_wpaudioplayer still work?
My template.php file is in sites/all/themes/subzen/template.php.
Thanks again for your help and guidance.
Comment #8
tamerzg CreditAttribution: tamerzg commentedYes it will work.
Comment #9
stanb CreditAttribution: stanb commentedYes, it DOES work! Thank you so much. I only wish I understood WHY it works. I know that Drupal looks in the sites/all/themes folder for template.php but how it knows to associate this function with your module, I don't have clue.
If you wouldn't mind telling me which Drupal docs I can read that may help me begin to understand this, I would be very appreciative. Thanks again for you guidance.
Comment #10
tamerzg CreditAttribution: tamerzg commentedMaybe you can start with this: http://drupal.org/documentation/theme
The thing is that you can override any theming function (ones that starts with theme_) in your theme template.php.
Comment #11
tamerzg CreditAttribution: tamerzg commentedComment #12
sheldonkemper CreditAttribution: sheldonkemper commentedCan someone help? I'm having the same issue as initially described in this thread. Its a shame this thread took a tangent towards WP player. The issue for xspf player is not solved for me. The mp3 plays, but the track listing show 'undefined'.
Comment #13
ws.agency CreditAttribution: ws.agency at Websolutions Agency commentedModule needs work. Issue with listing track name still 'undefined'
Comment #14
Anonymous (not verified) CreditAttribution: Anonymous at Websolutions Agency commentedAdded song title parameter. "Undefined" fixed.
Comment #15
Anonymous (not verified) CreditAttribution: Anonymous at Websolutions Agency commented