Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kolber/audiojs
A cross-browser javascript wrapper for the html5 audio tag
https://github.com/kolber/audiojs
Last synced: 13 days ago
JSON representation
A cross-browser javascript wrapper for the html5 audio tag
- Host: GitHub
- URL: https://github.com/kolber/audiojs
- Owner: kolber
- License: mit
- Created: 2010-12-01T23:19:16.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2018-09-25T12:29:23.000Z (about 6 years ago)
- Last Synced: 2024-10-19T10:02:01.027Z (20 days ago)
- Language: JavaScript
- Homepage: http://kolber.github.io/audiojs
- Size: 57.7 MB
- Stars: 2,106
- Watchers: 88
- Forks: 439
- Open Issues: 107
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-music - audio.js - audio.js is a drop-in javascript library that allows HTML5's <audio> tag to be used anywhere. (Audio Libraries)
- awesome-music - audio.js - audio.js is a drop-in javascript library that allows HTML5's <audio> tag to be used anywhere. (Audio Libraries)
README
# audio.js
audiojs is a drop-in javascript library that allows HTML5's `` tag to
be used anywhere. It uses native `` 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
1. Put `audio.js`, `player-graphics.gif` & `audiojs.swf` in the same folder.
2. Include `audio.js`:
3. Initialise audiojs:
audiojs.events.ready(function() {
var as = audiojs.createAll();
});
4. Then you can use `` wherever you like in your HTML:
## Bugs / Contributions
- [Report a bug](https://github.com/kolber/audiojs/issues)
- To contribute or send an idea, github message me or fork the project## Build
On OSX, you should install [closure compiler](http://closure-compiler.googlecode.com/files/compiler-latest.zip) following the instructions in
[Ben's gist](https://gist.github.com/739724).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
1. Download and unzip the current 'Milestone Release' 'Open Source Flex SDK' from:
2. Copy the `bin` folder to `/usr/local/bin/flex/bin/`
3. Add `/usr/local/bin/flex/bin/` to your `PATH`
### Compiling the SWF
Run the following command from within the `audiojs` folder.
mxmlc audiojs.as
### Bower packagebower install audiojs
### License
audio.js is released under the MIT license. Included MP3 and Ogg files are Creative Commons licensed tracks from [Bensound.com](http://www.bensound.com/)