The MediaRecorder.isTypeSupported()
static method returns a Boolean which is true
if the MIME type specified is one the user agent should be able to successfully record.
Syntax
var canRecord = MediaRecorder.isTypeSupported(mimeType)
Parameters
mimeType
- The MIME media type to check.
Return value
true
if the MediaRecorder
implementation is capable of recording Blob
objects for the specified MIME type. Recording may still fail if there are insufficient resources to support the recording and encoding process. If the value is false
, the user agent is incapable of recording the specified format.
Example
var types = ["video/webm",
"audio/webm",
"video/webm\;codecs=vp8",
"video/webm\;codecs=daala",
"video/webm\;codecs=h264",
"audio/webm\;codecs=opus",
"video/mpeg"];
for (var i in types) {
console.log( "Is " + types[i] + " supported? " + (MediaRecorder.isTypeSupported(types[i]) ? "Maybe!" : "Nope :("));
}
Specifications
Specification | Status | Comment |
MediaStream RecordingThe definition of 'isTypeSupported()' in that specification. | Working Draft | Initial definition. |
Browser compatibility
The compatibility table in this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
isTypeSupported
|
Chrome
Full support 47 |
Edge
Full support 79 |
Firefox
Full support 25 |
IE
No support No |
Opera
Full support 36 |
Safari
No support No |
WebView Android
Full support 47 |
Chrome Android
Full support 47 |
Firefox Android
Full support 25 |
Opera Android
Full support 36 |
Safari iOS
No support No |
Samsung Internet Android
Full support 5.0 |
Legend
- Full support
- Full support
- No support
- No support
See also
- MediaStream Recording API
- Using the MediaStream Recording API
- Guide to media types and formats on the web
- The "codecs" parameter in common media types
MediaStreamTrack
MediaStream
MediaCapabilities
MediaRecorder.isTypeSupported by Mozilla Contributors is licensed under CC-BY-SA 2.5.