peers / peerjs

Simple peer-to-peer with WebRTC.
https://peerjs.com
MIT License
12.48k stars 1.43k forks source link

Use `urls` property instead of `url` in RTCIceServer for iOS Mobile Safari #436

Closed dai-shi closed 6 years ago

dai-shi commented 6 years ago

https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer#Properties states that url is obsoleted.

More specifically:

https://github.com/peers/peerjs/blob/b88da6a1951802d1319e3b286e2e5105b5cd746b/lib/util.js#L1

From:

var defaultConfig = { iceServers: [{ url: "stun:stun.l.google.com:19302" }] };

To:

var defaultConfig = { iceServers: [{ urls: "stun:stun.l.google.com:19302" }] };

This only prevents peerjs to work with iPhone Mobile Safari.

dai-shi commented 6 years ago

This and this https://github.com/peers/peerjs/issues/394#issuecomment-385603404 worked for me.

kidandcat commented 6 years ago

Wouldn't you need to provide then an array of urls instead of a string?

var defaultConfig = { iceServers: [{ urls: ["stun:stun.l.google.com:19302"] }] };
dai-shi commented 6 years ago

https://developer.mozilla.org/en-US/docs/Web/API/RTCIceServer#Properties

urls This required property is either a single DOMString or an array of DOMStrings, each specifying a URL which can be used to connect to the server.

Macil commented 6 years ago

Firefox seems to want this too. In Firefox, I get this warning in the console: "RTCIceServer.url is deprecated! Use urls instead."

kidandcat commented 6 years ago

Done by @i0n, peerjs version 0.3.17