kolber/audiojs
kolber/audiojs has 2,076 GitHub stars and 431 forks. GitHot measured 0 stars in 24 hours. Last checked 2026-11-07 23:13 UTC. Last push 2018-09-25.
A cross-browser javascript wrapper for the html5 audio tag
Measured star growth
- in 24h
- 0
- in 7 days
- Collecting history
- in 15 days
- Collecting history
- in 1 month
- Collecting history
Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.
README.md
Originalaudio.js
audiojs is a drop-in javascript library that allows HTML5's <audio> tag to
be used anywhere. It uses native <audio> where available and falls back
to an invisible flash player to emulate it for other browsers. It also serves
a consistent html player UI to all browsers which can be styled used standard css.
It plays mp3s. No ogg. Because, lets be honest, in the real world, no one really exports ogg files. Sadly, that means Opera and Firefox get flash audio. Hopefully they can add mp3 support soon.
Usage
Put
audio.js,player-graphics.gif&audiojs.swfin the same folder.Include
audio.js:<script src="/audiojs/audio.js"></script>Initialise audiojs:
<script> audiojs.events.ready(function() { var as = audiojs.createAll(); }); </script>Then you can use
<audio>wherever you like in your HTML:<audio src="/mp3/juicy.mp3" preload="auto" />
Bugs / Contributions
- Report a bug
- To contribute or send an idea, github message me or fork the project
Build
On OSX, you should install closure compiler following the instructions in Ben's gist.
Then you can run rake compile from root directory and it will package audio.js
into audio.min.js.
Compiling Flash from the command line
If you want to mess around with the flash-side of things, you will need to be
able to compile the .as file into a .swf.
Using the Flex SDK (which is free), flash movies can be compiled directly from the command line. It makes life that little bit less painful.
Installing mxmlc
Download and unzip the current 'Milestone Release' 'Open Source Flex SDK' from: http://opensource.adobe.com/wiki/display/flexsdk/Download+Flex+4
Copy the
binfolder to/usr/local/bin/flex/bin/Add
/usr/local/bin/flex/bin/to yourPATH
Compiling the SWF
Run the following command from within the audiojs folder.
mxmlc audiojs.as
Bower package
bower install audiojs
License
audio.js is released under the MIT license. Included MP3 and Ogg files are Creative Commons licensed tracks from Bensound.com
Explore related projects
ytdl-org/youtube-dl
Command-line program to download videos from YouTube.com and other video sites
141,473 starsexcalidraw/excalidraw
Virtual whiteboard for sketching hand-drawn like diagrams
135,294 starsgodotengine/godot
Godot Engine – Multi-platform 2D and 3D game engine
119,710 starsmrdoob/three.js
JavaScript 3D Library.
117,745 stars