Automatically adds html5 audio elements inline beside links to mp3, ogg, and wav files.
You can download it from github at https://github.com/matthewkastor/audio-tag-injector or, if you have node installed you can get it from npm
npm install audio-tag-injector
Using this module in your browser is as simple as including it in your page
audioTagInjector() after the page has loaded. See
in the root directory of this package.
The HTML5 audio tags will be added inline where this script finds a link
href attribute ends in mp3, wav, or ogg. A basic error handler is
added to the audio element to inform the user if the audio file couldn't load.
The audio element also displays an error message if it is not supported in
the users browser.
If you're using this module outside of a browser you will have to supply a
reference to a dom document object, unless you've called it
and declared it globally. I did not require any specific module for parsing the
DOM, because there are a few out there and it would be rude of me to force you
to use a specific one for such a simple function.
Example Usage of audio-tag-injector.jsExample Usage of audio-tag-injector.jsOoh! I made some audio! Check it out Kastor at the mic!