Community Documentation

Audiofield

Last updated May 12, 2012. Created by tamerzg on November 16, 2010.
Edited by mkadin, monican. Log in to edit this page.

Go back to AudioField

Installation

In order to activate this module you have to get one of audio players from the following links
1. http://wpaudioplayer.com/download *Note make sure you should download the standalone edition
2. http://sourceforge.net/projects/musicplayer/files/musicplayer/slim-playe...
3. http://www.premiumbeat.com/flash_music_players/original/single/
4. http://www.premiumbeat.com/flash_music_players/original/thin/
5. http://www.premiumbeat.com/flash_music_players/original/mini/
(Premiumbeat.com no longer offers the music players)
6. Install FlowPlayer module (http://drupal.org/project/flowplayer) to use Flowplayer (optional)
7.http://www.jplayer.org/ VERSION 2.0, not 2.1 (7.x-1.x only)
8. Soundmanager2 http://www.schillmania.com/projects/soundmanager2/doc/download/ (6.x-1.x-dev only)

Where to extract the players?

Once you got any of the above audio players you have to create a new folder called "player "at this
directory "sites/all/libraries". Now you can unzip the audio players directly into the "player" folder.
If you wish to save players in different folder you can change it from admin/settings/audiofield and enter new path under "Audio Players Directory".

If using the default settings, resulting folder structure should resemble the following (you may need to rename the folders and files to match):

> The standalone WordPress player should be at:
/sites/all/libraries/player/audio-player/player.swf

> The slim player should be at:
/sites/all/libraries/player/xspf_player_slim.swf

> The Premium Beat single track player should be at:
/sites/all/libraries/player/playerSinglePackage/playerSingle.swf

> The Premium Beat single track thin player should be at:
/sites/all/libraries/player/OriginalThinMusicPlayer.swf

> The Premium Beat single track mini player should be at:
/sites/all/libraries/player/LWMusicPlayer.swf

>The jPlayer should be at:
/sites/all/libraries/player/jPlayer/Jplayer.swf

>Soundmanager2 should be at:
/sites/all/libraries/player/soundmanager2/script/soundmanager2.js

Select default player

Go to admin/settings/audiofield and you will see list of available players. Player you select will be used as default player for all audio files.

Add audio upload to the content type

First you must add audiofield to the preferred content type. Adding a field is done as adding any other CCK field, select field type of "File" and widget of "Audio Upload".

How to upload and play audio file?

After adding audiofield to content type you can upload audio files when creating new nodes. Uploaded audio files will be rendered in default player you selected in admin form.

API

Originally this module supports only mp3 audio files. But other modules can extend this support by implementing hook_audiofield_players() in their modules.

For example to implement support for new example player you would do:

<?php
/* Example of creating additional players through hook_audiofield_players() */
function example_module_audiofield_players(){
   
$players['example']=array(
       
'path' => drupal_get_path('module','example_module').'/players/player.swf', //relative path to the player
       
'name' => 'Example player',
       
'download_link' => 'http://example.com/download',
       
'filetypes' => array('mp3','wav','wma'),   //List of audio files your player can play
       
'callback' =>'example_module_example_player',
    );
   
    return
$players;
}

function
example_module_example_player($player_path,$audio_file){
return
'<object><param name="autoplay" value="true" />
            <param name="controller"value="true" />
            <embed src="'
. $player_path . '"  width="65" height="21" float="left" wmode="transparent" flashvars="mediaPath=' . $audio_file .'&defaultVolume=100" autostart="true" loop="false"  controller="true" bgcolor="#FF9900" pluginspage="http://www.macromedia.com/go/getflashplayer" >
            </embed></object>'
;
}
?>

Comments

Thanks for

Thanks for explaination....
now working fine

I installed the 7.x-1.x-dev

I installed the 7.x-1.x-dev version, with a few players.
After enabling the module I don't see any "audiofield" at admin/settings...

It's because it is at

It's because it is at admin/config/audioplayer

Drupal 7.x is still dev

Drupal 7.x is still dev version and currently doesn't work. Please use 6.x version.

--------------
Tamer Zoubi
Freelancer, Drupalist
Web: zoubi.me
Skype: tamerzg2005

Drupal 7

Hi

Does this still not work for DRUPAL 7?
After trying to follow the instructions & having selected a player, in the edit section, I just have the audio file link & on the view page, just the text in body field.

I do not see what else to do.
Does one need to do anything to code & if so what??

I have also extracted 4 players to the player folder, but I only see 2 at admin/config/media/audiofield

=>
MP3 Audio Players:
XSPF Slim Player
Premium Beat Thin Player

What could the problem be? I assume one only moves the extracted contents of the player folders & not the folders + their contents.

Is this a good way to make podcasts or there is a better method?

Thanks & regards

Same problem...

Same problem...

Any ETA on when this will

Any ETA on when this will work for Drupal 7? Or a recommended alternative module?

New to Drupal - You Rock !

Thanks for helping a noob! This worked great and now I can post some fun stuff.

the same problem in drupal 7

I've done everything as above and it still doesn't show on page. I uploaded one mp3 file to test it and nothing happened. As if I didn't upload it at all. Trying to find out what happened I got this message:
/home/......../public_html/sites/all/modules/audiofield/audio.field.inc on line 276

I am also facing the same

I am also facing the same issue.

I installed PB thin player, PB single player, and Jplayer. Then created a node and uploaded a mp3 file. But only the PB thin player will play the track. The other two players do not play the track...

AutoPlay

Hi there

Has anyone tried getting the Mini flash mp3 player playing songs automatically when entering a page ?

I've created a node with an MP3 attached, and used a View to create a block showing only the Mini player.
This all works, and the player is showing, and the buttons are working as they should.

But I'd like to make the song play automatically when someone enters the page...

Anyone have any idea, how I can achieve this ?

I've tried the CUSTOMIZATION link at premiumbeat.com, and have tried copying the generated code into the .html files, that came with the MINI player. But I can't get this to work.

Hopefully someone can help me :-)

Sincerly
Tom

TDI

I did all the steps...

After numerous D6 sites, I have my first D7 site. I did everything as you directed me to do successfully, as best as I can tell. In any case, everything looked as I expected. And ultimately when at a "Create Audiofield" page there is a box at the bottom labeled: "MP3 Player" along with a browser button and "Files must be less than 10MB" and "Allowed file types: mp3." I identify the file (5MB) on my hard drive and click upload. It takes about 5-10 minutes and then I get an error message telling me that "The file could not be uploaded." Sadly, there is no other information

I'm not sure what to do and have tried a variety of fixes. At this point if I could manually embed the XSPF slim player & mp3 file, I would be delighted. I have tried numerous html commands such as . Nothing shows up.

Any suggestions? Thanks for your time and for the player.
David

PoolBum in da Philippines

Steps for D7

First of all, always get your installation instructions from the README.txt file that ships with the module version you are using. Installation instructions change from version to version and the documentation on drupal.org is always behind. Instructions that ship with modules are the only "official" instructions.

Installation steps:

  1. Download the module the way you normally do. (As of 8/28/11, both the Beta and Dev versions for D7 work)
  2. Do not install the module.
  3. Download your player of choice (either XSPF, jPlayer or Wordpress Standalone). Read the README.txt file for download locations.
  4. Make sure sites/all/libraries exists. Create a new folder named player inside libraries.
  5. Upload your player to the player folder (sites/all/libraries/player/) so that each player has a path like this:
    • Wordpress: sites/all/libraries/player/audio-player/player.swf *make sure you upload the entire folder to this location
    • XSPF: sites/all/libraries/player/xspf_player_slim.swf
    • jPlayer: sites/all/libraries/player/jquery.jplayer.min.js *make sure both files are uploaded here.
  6. Now, go install the module on the module page.
  7. Navigate to admin/config/media/audiofield and select your default player
  8. Create a new content type and add a File field with the new Audio Upload widget.
  9. Set your settings as you see fit.
  10. Create a new peice of content with your new content type and upload your audio.
  11. There you go.

Please note that the author of the module has chosen a horrible color scheme for the Wordpress Audio Plugin and given you no way to edit it from the admin screen.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

Followed this w no luck

I love that i read no where prior to installs that i should not install the operating modules before the players themselves, so i had installed the modules first, then the players. The players did not show up when i went to choose them, as is explained to happen here, so I removed the modules and jplayer and installed them the way suggested above and still, when i get to step 7, no players are listed and i get the message "You must install and select at least one player to be able to play the audio". This message is spammed across my whole site...

Can someone assist with some steps how to actually make the players appear so i can select them and proceed with adding them to a content type. The ui360 player (which i assume is part of the jplayer) is quite attractive and trying to get that on my D7 site. I'm not quite sure what Soundmanager2 is, if it's not a player, but i installed that and its module as well, but nothing shows up in audiofield config for players to add.

Can you take screenshots?

Can you take screenshots? Completely uninstall the module (including uninstalling it from the database), delete it, delete the players, run update.php, re-download the module, re-download the player of your choice. Take a screenshot of where you are installing the PLAYER. Install the module. Go to the admin page of the module where you select a player. Take a screen shot. Upload these somewhere I can see them and give me links.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

screenshots

http://postimage.org/image/26oh2x0is/
http://postimage.org/image/26opclqzo/

Neither Jplayer nor Soundmanager2 show up. I deleted the modules out of 'system' in the database and off the site and my computer. Setup as you directed. same problem, Audiofield doesn't find any players, does not offer any to select.

Have you tried XSPF or

Have you tried XSPF or Wordpress Player yet?

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

Only want to use the UI360

Sorry for the delay, had some things to take care of irl.

I have not tried them, I tried the other to see if it was just the Jplayer, but it's not giving me any option to select a player, yet it broadcasts that I need to across my whole site to myself and other web users.(live, i dont have the facility to run a test server). I'd really like to implement this, and it's written that it supposedly works with Drupal 7, but i'm not having any luck, and out of ideas for things to try.

Another solution

There is another solution here: http://mustardseedmedia.com/podcast/episode50

Maybe it will work better for you.

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

looks great but...

it doesn't see the libraries for this either. I checked the Media Element page, and did a google search and didn't find any workable solution. I figure this is something broken with D7? But then, if others get it to work... wtf... Is there something I have to do to Drupal 7 to let these modules access and 'know' the libraries location?

Libraries API

Media Element lists this module as a dependency, is this also the case for Audio Field and the players that have library files (not listed as a dependency and not on any steps for installation of these...). Could be the root issue I've been having, I'm moving forward with trying to get Media Element working instead/first.

Still a problem

Hi,
running linux OpenSuse 11.4
Drupal 7.x-dev (7.10 of 2012-jan-14)
clean install

jPlayer 2.1.0
audiofield 7.x-1.0-beta3 (2011-apr-18)

download and unpack jplayer so it matches audiofield.module:
line 177: sites/all/libraries/player/jplayer/jquery.jplayer.min.js

line 178: asks for sites/all/libraries/player/jplayer/jplayer.css
file do not exist

downloads and unpack audiofield to
sites/all/module/contrib/audiofield

enables audiofield
going to admin/config/media/audiofield
and get a white screen

Going back to frontpage following message is given:
You must install and select at least one player to be able to play the audio.

Can you give me a solution?

Using this module with external media

I want to be able to use the player but with the MP3 held on an external source.
(Hosting media consumes a lot of disk space and bandwidth, I am using links to dropbox.com, which provides 2 gig of space and a folder which is accessable publically).

e.g. I want to simply enter the URL to the remote file without it triggering an upload.

I have experience of modifying php code, so cold possible modify a copy of this module, however it would make more sense to have this feature implemented as another field type in or property in audiofield.

Exactly what I would like to do...

Did you make this modification? I would like to also link to an external file (Rackspace Cloud Files in my case). How you described above would really meet my needs. Or do you have a recommendation for another module that may do the same thing? I need the audio player linked to an external source. Thanks!

You can use the theme layer

You can use the theme layer to do this already. Add a link to your file as a text field, and follow these instructions: http://drupal.org/node/524344

Anthony Pero
Project Lead
Convergent Creative Web Design
http://www.convergentcreative.com/

Hi!

First of all thank you for the great module. I've installed it and it worked out of the box on my Drupal 7 installation.

But the problem is that i see wpaudio player appears at the bottom of ARTICLES, but if i want to attach audio to BOOK i see only attached file without player. I tried to debug and figure out that for the BOOK content type "audiofield" module doesn't even called and this field is handled by the "file" module.

How can i solve this problem?

Edit WordPress Player Colors

I'm a bit stymied here... I solved the immediate problem by customizing the code in audiofield.module, but know that is a visual-catastrophe-upon-update waiting to happen. It looks like there is supposed to be a way to customize the coloring of the player that should be update-proof, but for the life of me I cannot figure out how to make it work... and there is no real documentation I can find to help... HELP?

tengo un problema

el problema es el siguiente:
instalo correctamente el modulo AudioField correctamente, incluyo en la librería el reproductor de Wordpress y sus scripts correctamente, lo direcciono el path para el jugador al momento de agregar una campo a un tipo de contenido se lo hace correctamente field_audio tipo Archivo y Audio upload todo bien hasta ahí pero al momento de publicar en el tipo de contenido me sale este error: Notice: Undefined index: progress_indicator en file_field_widget_form() (línea 466 de /home/erbolco/public_html/ultimahora/modules/file/file.field.inc).

como puedo solucionar esto agradeceré mucho una respuesta o guía gracias.

This issue has a bug report

See the bug report at: http://drupal.org/node/1433326

There is a work-around posted there as well.

Premiumbeat.com players no longer available

The premiumbeat.com players are not longer available. Maybe they could be removed from the installation information.

I found that out as welll

are there any suggestions for other players?
I'm trying to use dewplayer... I've created a folder in player called dewplayer and have the swf files in there.
So its...
sites/all/libraries/player/dewplayer/dewplayer.swf
sites/all/libraries/player/dewplayer/dewplayer-bubble.swf
sites/all/libraries/player/dewplayer/dewplayer-mini.swf
etc.

but none of these are options in the audio field settings.

About this page

Drupal version
Drupal 7.x
Audience
Documentation contributors
Drupal’s online documentation is © 2000-2012 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here