Detect playable audio and video filetypes
JavaScript
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src
test
.gitignore
GruntFile.js
README.md
package.json
plays.js
plays.min.js

README.md

plays

HTML5 <audio> and <video> feature detects

API (0.7)

plays(type, elem?)

plays('audio/mp3') // => boolean
plays('mp3', 'audio') // => boolean
["mp3", "wav"].some(plays, 'audio') // => boolean

Properties

plays.audio ⇒ array

plays.audio[0] // => the most probable type
plays.audio.length // => number of available types
plays.audio.m4a // => "probably"|"maybe"|""
plays.audio.mp3 // => "probably"|"maybe"|""
plays.audio.wav // => "probably"|"maybe"|""
plays.audio.ogg // => "probably"|"maybe"|""
plays.audio.opus // => "probably"|"maybe"|""

plays.video ⇒ array

plays.video[0] // => the most probable type
plays.video.length // => number of available types
plays.video.ogg // => "probably"|"maybe"|""
plays.video.mp4 // => "probably"|"maybe"|""
plays.video.webm // => "probably"|"maybe"|""

License: MIT

Copyright (C) 2013 by Ryan Van Etten