1.0.2 • Published 9 years ago

supported-audio v1.0.2

Weekly downloads
17
License
VOL
Repository
github
Last release
9 years ago

supported-audio

Returns the best supported audio type for your browser of the types you provide.

Build Status

Meant to be used in the browser with browserify.

example

var bestSupported = require('supported-audio')

bestSupported([ 'ogg', 'wav', 'mp3' ]) // => 'mp3'
bestSupported([ '.ogg', '.wav', '.mp3' ]) // => 'mp3'
bestSupported([ 'file.ogg', 'file.wav', 'file.txt.mp3' ]) // => 'mp3'
bestSupported([ 'audio/ogg', 'audio/wav', 'audio/mp3' ]) // => 'mp3'
bestSupported([ 'lol', 'rofl', 'ttyl' ]) // => null

api

var bestSupported = require('supported-audio')

var type = bestSupported(types)

  • types is an array of types to check.
  • Returns a string or null.

install

With npm do:

npm install supported-audio

license

VOL

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago