MediaRecorder is not supported in Safari Browser

585 Views Asked by At

[Log] Webcam permission error

Error: MediaRecorder is not supported

I am trying to record audio. Audio recording is working fine in Chrome Browser. But throwing an error in Safari.

global.audioStream = await navigator.mediaDevices.getUserMedia({ audio: true });

global.audioChunks = [];

const canRecord = MediaRecorder.isTypeSupported('video/webm; codecs=vp8');

Can anyone help?

1

There are 1 best solutions below

3
On

MediaRecorder API is supported in Safari from version 14.1 (Released 2021-04-26).

There are 2 ways how to handle this issue:

  • Inform user that Safari update is required for this functionality (easy, but not so delicate and not acceptable if old Safari support is required);
  • Implement a server-side recording - send media stream via WebRTC to any media server (Janus, MediaSoup; GStreamer can be also used) and record it at server side - much more complicated, but 100% working with older Safari versions (starting from Safari 11). You'll need a media server installed and any kind of load balancing for high load, but it's the only one way how to implement it in browsers without MediaRecording API support.