RecordRTC icon indicating copy to clipboard operation
RecordRTC copied to clipboard

Bug using firefox with 'video/webm;codecs=vp8'

Open ronaldohoch opened this issue 11 months ago • 1 comments

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:

image

ronaldohoch avatar Sep 12 '23 03:09 ronaldohoch

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'
}

ronaldohoch avatar Sep 12 '23 03:09 ronaldohoch