can-play-type-to-number
Convert a string which .canPlayType() may returns into a number (0 - 2)
; //=> 2; //=> 1; //=> 0 ; //=> throws an error
Installation
Package managers
npm
npm install can-play-type-to-number
Bower
bower install can-play-type-to-number
Standalone
Download the script file directly.
API
canPlayTypeToNumber(playability)
playability: String
('probably'
, 'maybe'
, or ''
)
Return: Number
(0 - 2)
argument | return |
---|---|
'probably' |
2 |
'maybe' |
1 |
'' |
0 |
It throws an error when the argument isn't included in the list above.
License
Copyright (c) 2014 - 2015 Shinnosuke Watanabe
Licensed under the MIT License.