supported-audio

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i supported-audio

Weekly Downloads

2

Version

1.0.2

License

VOL

Last publish

Collaborators

  • artskydj