Summary: Play HTML5 Audio
Version: 20160205
Prerequisites: none
Status: working
Maintainer: GNUZoo
Users: +1 (View / Edit)
Categories: Audio Markup HTML5 Media
Downloads: HTML5Audio.phpΔ
Discussion: HTML5Audio-Talk

Questions answered by this recipe

  • How to play HTML5 Audio?
  • How to play ogg Audio?
  • How to play mp3 Audio?
  • How to play wav Audio?

This section is optional; use it to indicate the types of questions (if any) this recipe is intended to answer.


Enter your recipe's description here. This recipe makes it easy to add HTML5 Audio.

It will first try to play ogg, then oga, then mp3 then wav. If the browser does not support HTML5 Audio it will display "Your browser does not allow HTML5 audio.".

Actual filenames should end with lowercase "ogg" or ".oga" for ogg, ".mp3" for mpeg, and ".wav" for wave.


(:html5audio filename=lounge_music :)


  • filename - first part of file - so if the file was lounge_music.ogg it would be "lounge_music"


Copy HTML5Audio.phpΔ to your cookbook directory

In your config.php enter:


or in your farmconfig.php enter:


This program sets the default directory to contain audio in "\uploads\".

To change the default directory set a variable in your config.php file like this:

   $HTML5AudioDir = '';


Release notes

This program is free software.
You can redistribute it and/or modify it under
the terms of the GNU General Public License as
published by the Free Software Foundation either version 2 of the
License, or (at your option) any later version.

Copyright 2007

  • Version: 1.0 - Initial release
  • Version 20160205: add php5.5 support

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See also




See discussion at HTML5Audio-Talk

User notes +1: If you use, used or reviewed this recipe, you can add your name. These statistics appear in the Cookbook listings and will help newcomers browsing through the wiki.