RecordRTC
RecordRTC copied to clipboard
Bug using firefox with 'video/webm;codecs=vp8'
Hello Muaz-khan and other contributors!
Running this code:
navigator.mediaDevices
.getUserMedia({
video: {
deviceId: { exact: this.selectedVideoDeviceId },
// width: { ideal: 99999 },
// height: { ideal: 99999 }
},
audio: {
deviceId: { exact: this.selectedAudioDeviceId }
},
})
.then(async (stream: MediaStream) => {
const sleep = m => new Promise(r => setTimeout(r, m));
this.recorder = new RecordRTC(stream, {
type: 'video',
mimeType: 'video/webm;codecs=vp8',
previewStream: () => {
}
});
///rest of code..
Throws this error:
For a while, my workaround was that:
let navigatorCodec:RecordRTC.Options['mimeType'] = 'video/webm;codecs=vp8';
if (navigator.userAgent.includes('Firefox')) {
navigatorCodec='video/webm;codecs=h264'
}