RTCMultiConnection icon indicating copy to clipboard operation
RTCMultiConnection copied to clipboard

not working on iOS 14

Open ossipoff opened this issue 4 years ago • 24 comments

It seems Apple has made some changes in iOS 14 that are not playing nice with RTCMultiConnection.

I have tested all the demos at https://rtcmulticonnection.herokuapp.com/demos/, but none of them are working.

Not entirely sure what the problem is, it doesn't seem like any errors are logged to the console, but the local video stream is never shown and is not sent to the recipient either.

Local audio stream seems to be working, also remote audio and video streams are displayed on the iOS 14 device.

It doesn't seem to be a general problem with getUserMedia or something like that, the following getUserMedia example is working fine: https://webrtc.github.io/samples/src/content/getusermedia/gum/

ossipoff avatar Sep 21 '20 15:09 ossipoff

+1 Same problem

ricardogobbosouza avatar Sep 23 '20 13:09 ricardogobbosouza

I have run into the same problem. It is happening with a number of webrtc type applications. Does any one know of a solution to this problem?

gh264367 avatar Sep 27 '20 14:09 gh264367

Here is something that I found on iOS 14:

Important changes to iOS 14 networking affecting relayed sessions

With iOS 14, Apple introduces local network privacy.

Beginning in iOS 14, the operating system will prompt the user for permission when an application attempts to subscribe to clients on the same local network in a relayed session.

If your application uses a relayed session, it is encouraged to add a descriptive custom usage string to inform the user why the application needs access to their local area network. The Video API uses the local network to discover and connect to video participants on your same network where possible.

If the user does not accept the permission, the attempt to subscribe will fail. After the permission is rejected, any future attempts to subscribe to clients on the same network will also fail unless the user changes the permission in Settings. Unfortunately, iOS does not provide an API for an application to determine if the user has accepted or rejected this permission.

Hopefully this information will help solve for a solution. If someone has one, please post it.

gh264367 avatar Sep 27 '20 14:09 gh264367

+1 - having the same problem. I'm able to stream to users but unable to switch cameras on iOS. Any insights how does one go about it?

chai2 avatar Sep 28 '20 06:09 chai2

Chai2, are you still able to stream to users using iOS 14? If so, how are you doing it? Can you post something or we can reach out to one another. I have the ability to switch cameras on iPads and iPhones figured out.

gh264367 avatar Sep 28 '20 11:09 gh264367

@gh264367 - I just realized I'm on 13.7 and can stream. Let me update to 14.0.1 and see if it still works.

chai2 avatar Sep 28 '20 15:09 chai2

Nope, just tested it out. And, all I see is a blank screen.

chai2 avatar Sep 28 '20 16:09 chai2

@gh264367 I also found a note regarding the ios 14 issue here https://tokbox.com/developer/sdks/ios/release-notes.html it seems as though it is related to peer-to-peer connections. We are using xirsys for stun and turn. I have tried to use turn servers only, but still have the same issue.

ossipoff avatar Sep 28 '20 18:09 ossipoff

This seems to be a permission thing with iOS 14 on the local network of the device, from researching for peer to peer in webrtc. Some how you have to ask permission within Safari to connect to the local network of the device.

gh264367 avatar Sep 28 '20 19:09 gh264367

I have done some searching and testing, and found an example of webrtc that actually works on ios 14: https://apprtc.appspot.com/

I found it in the bottom of this list of samples: https://webrtc.github.io/samples/

the source code for it is here: https://github.com/webrtc/apprtc/

it will take some time to rummage through all the source and find out what makes this one work compared to rtcmulticonnection. I probably won't have the time for it in the near future

ossipoff avatar Sep 28 '20 20:09 ossipoff

Thanks, @ossipoff. I just tried and it works as expected. I will keep looking at where in this repo need to be patched.

chai2 avatar Sep 28 '20 21:09 chai2

More information if anyone is interested - It's confirmed - related to Local network permissions.

WebRTC - https://bugs.chromium.org/p/webrtc/issues/detail?id=11859 Details info - https://developer.apple.com/videos/play/wwdc2020/10110/

chai2 avatar Sep 30 '20 01:09 chai2

Same Problem here.

danielehrhardt avatar Oct 01 '20 15:10 danielehrhardt

Same Problem after upgrade to ios 14

before, on ios 13, project work perfect

talshimoni avatar Oct 07 '20 21:10 talshimoni

Twillio is aware of the issues as well, it's seem best to avoid local network at all for ios14 device

https://support.twilio.com/hc/en-us/articles/360053909533-Important-Changes-in-iOS-14-for-Twilio-Video-P2P-Rooms

altezza04 avatar Oct 11 '20 07:10 altezza04

@altezza04 do you have an idea of how to avoid the local network in rtcmulticonnection? I have tried only using turn servers, but that didn't work. I am no expert in webrtc, but I guess it has to do with the way it is handling ICE candidates

ossipoff avatar Oct 12 '20 15:10 ossipoff

@altezza04 do you have an idea of how to avoid the local network in rtcmulticonnection? I have tried only using turn servers, but that didn't work. I am no expert in webrtc, but I guess it has to do with the way it is handling ICE candidates

no idea actually, may need some way to forcing a relayed connection in Peer-to-Peer Rooms to avoid using the local network.

altezza04 avatar Oct 13 '20 02:10 altezza04

Any solutions so far?

fmangat avatar Nov 03 '20 14:11 fmangat

GUYS, I found the solution to it

fmangat avatar Nov 06 '20 09:11 fmangat

the problem is in getRMCMediaElement function.

comment out

mediaElement.srcObject = stream;

this line and it will work. the reason might be is that you cant create more than 1 media element with local stream

fmangat avatar Nov 06 '20 09:11 fmangat

maybe someone can come with a much cleaner approach

fmangat avatar Nov 06 '20 09:11 fmangat

@fmangat , that sounds great! I will try it out

ossipoff avatar Nov 06 '20 13:11 ossipoff

I found that setting the autoCreateMediaElement property to false on the connection object also works

ossipoff avatar Nov 06 '20 14:11 ossipoff

I have the same problem.

rezashnia1234 avatar Nov 21 '20 15:11 rezashnia1234