📜 ⬆️ ⬇️

audio.js - listen to music in any browser

audio.js is a javascript library that allows you to use the HTML5 tag everywhere. What is behind the word "everywhere". If it is possible to use the tag, it will be used, otherwise the player will be connected to flash. The library also includes UI mapping for this player, which can be modified using css.

How to use.

Put audio.js , player-graphics.gif and audiojs.swf in one folder.
Then we connect the script
<script src="/audiojs/audio.js"></script> 

And initialize:
 <script> audiojs.events.ready(function() { var as = audiojs.createAll(); }); </script> 

Now it remains only to insert the code on the page
 <audio src="/mp3/juicy.mp3" preload="auto" /> 

Examples

A couple of examples from the author
Example 1 - Player and Playlist
Example 2 - several players with the test of the following attributes: preload, loop and autoplay.

Browser Support

Connecting Flash in theory should make this library as cross-browser as possible. Currently tested in the following systems:

Ogg format support

The audio.js library is aimed at playing mp3. And at the moment there is no ogg support, for the reason that mp3 is much more common. So the ogg connection has a very low priority.

')

Source: https://habr.com/ru/post/110906/


All Articles