I'm using simplepeer.min.js client side to instantiate and connect peers. My code runs in Chrome on my Mac, however I get TypeError: Error creating RTCPeerConnection in Safari as well as both Chrome and Safari on my phone. Has anyone seen/dealt with this before?
Hello, what iOS version You have?
If I'm not wrong, I think that apple only supports WebRTC in version 11.1 +
@MaciejWWojcik You're right, this feature was only recently enabled by Apple. I'm on 11.0.3 so it should be supported in my browsers.
Here's a sample of my code where I'm seeing the error:
`
script src="simplepeer.min.js" type="text/javascript"
script src="socket.io.js" type="text/javascript"
script type="text/javascript"
if(SimplePeer.WEBRTC_SUPPORT) {
var socket = io.connect();
socket.on('connect', function() {
socket.emit('room', 'SOME_STRING');
});
socket.on('peer', function(data) {
var peerId = data.peerId;
var peer = new SimplePeer ({
initiator: data.initiator,
channelName: 'SOME_STRING',
config: {iceServers: [{url: 'stun:stun.l.google.com:19302'}]},
trickle: true,
objectMode: true
});
...
}
/script
`
Safari doesn't support the url configuration, only urls (url is non-standard).
{iceServers: [{urls: 'stun:stun.l.google.com:19302'}]}
Most helpful comment
Safari doesn't support the
urlconfiguration, onlyurls(urlis non-standard).{iceServers: [{urls: 'stun:stun.l.google.com:19302'}]}