Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

thebigk's avatar
Level 13

WebRTC & Chrome Vs Safari - How to make it work?

I'm creating a simple web-based video recorder. I got everything working on Chrome and then to my horror, started getting mimeType not supported error on Safari. After debugging, it looks like the entire problem is about using the right configuration in this line -

// Works in Safari, but not in Chrome. Tested only once
this.mediaRecorder = new MediaRecorder(window.stream, {mimeType:'video/mp4;codecs=avc1'});

// Works in Chrome, but not in Safari.
this.mediaRecorder = new MediaRecorder(window.stream, {mimeType:'video/webm;codecs=vp9,opus'});

I've tried including adapterJS, but the problem doesn't go away.

The obvious choice here is to check the browser and then load the appropriate mimeType. However, I'm not sure if this will work across multiple platforms (Android, iOS, Windows, MacOS).

Is there any way to fix this and make videos work fine across all the browsers? Would appreciate your guidance. Thank you for your time.

0 likes
3 replies
thebigk's avatar
Level 13

@Sinnbeck , thank you for the response. The library only supports audio; whereas I'm looking for a video recorder.

Sinnbeck's avatar

@thebigk ah bad example. But I am sure someone built a lib that supports safari

Please or to participate in this conversation.