Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ryanve/plays
Detect playable audio and video filetypes
https://github.com/ryanve/plays
Last synced: about 1 month ago
JSON representation
Detect playable audio and video filetypes
- Host: GitHub
- URL: https://github.com/ryanve/plays
- Owner: ryanve
- Created: 2013-10-31T16:19:37.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-02-24T03:00:57.000Z (over 10 years ago)
- Last Synced: 2024-10-05T22:36:13.669Z (about 1 month ago)
- Language: JavaScript
- Homepage: https://www.npmjs.com/package/plays
- Size: 145 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# [plays](../../)
#### HTML5 `` and `` feature detects
## API ([0.7](../../releases))
### plays(type, elem?)
```js
plays('audio/mp3') // => boolean
plays('mp3', 'audio') // => boolean
["mp3", "wav"].some(plays, 'audio') // => boolean
```### Properties
#### plays.audio ⇒ array
```js
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
```js
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](http://opensource.org/licenses/MIT)
Copyright (C) 2013 by [Ryan Van Etten](https://github.com/ryanve)