Safari WebRTC with easyrtc

1k Views Asked by At

On Chrome, I'm getting full Webcam & Microphone support both ways with easyrtc.js, but Safari doesn't want to cooperate.

The latest version of Safari is listed as being WebRTC compatible (https://webkit.org/blog/7627/safari-technology-preview-32/). In addition, I have the option to "Enable Legacy WebRTC API" under the Develop menu.

Without Legacy WebRTC API enabled, I get the error message from easyrtc Your browser doesn't appear to support WebRTC. After enabling it, I get the error message Unhandled Promise Rejection: TypeError: Type error from the easyrtc.js this.createObjectURL function at: window.URL.createObjectURL(mediaStream).

Any ideas how to get Safari to behave like the Chrome version?

2

There are 2 best solutions below

0
J4GD33P 51NGH On BEST ANSWER

Faced the same problem with easyrtc then used beta branch of easyrtc in development and it works. Previous, was using master branch.

beta branch includes playsinline for safari.

Clone their beta branch using :

git clone -b <branchName> <repository>
means

git clone -b beta https://github.com/priologic/easyrtc.git

0
wpp On

Disclaimer: I know nothing about easyrtc.js

It looks like easyrtc relies on an older version of the WebRTC API to detect WebRTC compatibility, which explains why the Legacy option "gets you further".

As far as the promise error goes: this.createObjectURL has been deprecated for quite a while in favour of srcObject assignment.

Any ideas how to get Safari to behave like the Chrome version?

You probably won't get them to behave alike. But I would recommend you checkout adapter and include it in your project. This is a project which tries to eliminate these kinds of API differences between browser vendors until the API has been stabilised.