dev

HTML5AudioPlayer allows you to play audio files with HTML5's native audio player. The supported audio formats depend on the browser (consult table below).

Installation

Usage

<div class="html5audio" data-file="URL-to-file">You need to enable JavaScript to play this audio</div>

Required parameters

Optional parameters

Example

Example with most parameters in use:

<div class="html5audio" data-file="https://upload.wikimedia.org/wikipedia/commons/5/50/Chopin_Cello_Sonata_Op._65_-3.ogg" data-volume="0.7" data-download="false" data-preload="metadata" data-options="loop">You need to enable JavaScript to play this audio</div>


Results in the following:

You need to enable JavaScript to play this audio

Supported formats by browser

Format Chrome Edge Firefox Opera Safari
AAC YES YES YES[1] YES YES
ALAC NO NO NO NO YES
MP3 YES YES YES YES YES
FLAC YES YES YES NO YES
Opus YES YES YES YES NO
OGG (Vorbis) YES YES YES YES NO
WAV YES YES YES YES YES
  1. Firefox only supports AAC within an MP4 container, and only when the operating system has the supported codecs installed.

From W3Schools and MDN

See also

Text above can be found here (edit)