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.
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.
js
MediaRecorder.isTypeSupported(mimeType)
mimeType
The MIME media type to check.
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.
js
const types = [ "video/webm", "audio/webm", "video/webm;codecs=vp8", "video/webm;codecs=daala", "video/webm;codecs=h264", "audio/webm;codecs=opus", "video/mpeg", ]; for (const type of types) { console.log( `Is ${type} supported? ${ MediaRecorder.isTypeSupported(type) ? "Maybe!" : "Nope :(" }`, ); }
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | WebView Android | Chrome Android | Firefox for Android | Opera Android | Safari on IOS | Samsung Internet | |
isTypeSupported_static |
47 | 79 | 25 | No | 36 | 14.1 | 47 | 47 | 25 | 36 | 14 | 5.0 |
© 2005–2023 MDN contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/MediaRecorder/isTypeSupported_static