Skip to content

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

Notifications You must be signed in to change notification settings

ArtskydJ/supported-audio

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

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

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published