Drupal: using 'Node displays' and 'Display Suite' to present audio in HTML 5 format
Monday, 23 May 2011 - 3:22pm
If you want to present video in HTML5 format in Drupal, the Video for Everybody! module works very well. For audio, you could also use Video for Everybody! but the dimensions of the player hardcodes a poster image and does not hide the video portion of the player. An 'Audio for Everybody' module could be written, but an alternative approach is to use Node Displays and Display Suite to create a 'HTML5 Audio field'. The advantages of this approach:
Customise the Display Suite layout for the Interview content type
Go to Site building > Display suite > Layout > Interview > Full node
Under the 'Disabled' section locate 'HTML5 Audio' and drag it into one of the regions (Left, Middle Right or Footer).
Click Save.
View and test
View an Interview node. You should see the appropriate HTML5 player controls.
MP3 Audio
An alternative approach is to use mp3 files. To do this just substitute 'mp4' with 'mp3'. So the best cross-browser combinations are mp4 + ogg or mp3 + ogg.
Video
Note that the this approach can be used for HTML5 video as well. You just have to add another custom field for the Poster field, and modify the Field code. Let me know how this goes for you.