Check if your browser can play different types of audio:
The canPlayType() method checks if the browser can play the specified audio type.
The canPlayType() method can return one of the following values:
The canPlayType() method is supported in all major browsers.
Note: This method is not supported in Internet Explorer 8 and earlier.
Value | Description |
---|---|
type | Specifies the audio type (and optional codecs) to test support for. Common values:
Common values, including codecs:
Note: This method can only return "probably" if codecs are included. |
Return Value: | A String, representing the level of support. Possible return values:
|
---|