1

I have been trying to set up WebRTC but I am having an issue with Safari and data channels. I have a demo set up here and it works on Chrome but it only works on Safari if navigator.mediaDevices.getUserMedia is called (line 92) even though I am not using the media in any way.

EDIT: The RTCDataChannel samples at https://webrtc.github.io/samples/ work just fine but for some reason my demo doesn’t work.

Brandon
  • 323
  • 2
  • 12
  • Hard to say what the problem might be. I assume the RTCPeerConnection-Object has also in Safari the icegatheringstate "complete", connectionstate "connected" and iceconnectionstate "connected"? Can you perhaps post some of your code to help others debugging or reviewing it? – nasskalte.juni Oct 23 '19 at 13:50
  • @nasskalte.juni when `getUserMedia` isn't called the connectionstate and iceconnectionstate go to "failed" but when it is called they connect – Brandon Oct 23 '19 at 14:33
  • seems you were right about the weird permission issue in Safari. I had a look at it and also searched for similar problems and came accross [this](https://stackoverflow.com/q/46605141/5025161) and [this](https://stackoverflow.com/a/54534351/5025161). Long story short: Safari decided to bind the ICE-gathering-process to the usermedia permission. Safari will not produce host or further candidates until the user accepted the use of media, even when it is not used at all – nasskalte.juni Oct 24 '19 at 11:13

0 Answers0