The MediaRecorder.isTypeSupported()
method returns a Boolean which is true
if the MIME type specified is one the user agent can record.
var canRecord = MediaRecorder.isTypeSupported(mimeType)
mimeType
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.
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 :(")); }
Specification | Status | Comment |
---|---|---|
MediaStream Recording The definition of 'isTypeSupported()' in that specification. | Working Draft | Initial definition. |
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari (WebKit) |
---|---|---|---|---|---|
Basic support | 47.0 | 25.0 (25.0) | ? | ? | ? |
Feature | Android | Android Webview | Firefox Mobile (Gecko) | Firefox OS | IE Mobile | Opera Mobile | Safari Mobile | Chrome for Android |
---|---|---|---|---|---|---|---|---|
Basic support | No support | No support | 47 | 25.0 (25.0) | ? | ? | ? | 47.0 |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported