client-sdk-js icon indicating copy to clipboard operation
client-sdk-js copied to clipboard

IOS safari doesn't connect to a room.

Open tsyrya opened this issue 2 years ago • 10 comments

SDK verion: 0.17.1 LiveKit server version: 15.5 IOS version: 15.3

Only in IOS safari the client can't connect to a room. If the client connects without publishing any media stream then after some time the connection happens. But if there is at least one publishing media stream, then seems like the client can't finish the connection.

tsyrya avatar Mar 25 '22 08:03 tsyrya

Are you able to reproduce with the sample JS client?

davidzhao avatar Mar 26 '22 07:03 davidzhao

@davidzhao Yeah, same behavior. The log window says "could not connect after timeout". Screenshot from 2022-03-28 09-32-36 photo_2022-03-28_09-33-54

The first screenshot were taken from a PC, and the second from an iphone.

tsyrya avatar Mar 28 '22 01:03 tsyrya

Ah I see the issue, you are loading the sample app over insecure HTTP. Mobile Safari does not allow media capture when it's running over an insecure connection.

Can you try going to https://example.livekit.io ?

davidzhao avatar Mar 28 '22 06:03 davidzhao

photo_2022-03-28_15-33-21

Unfortunately, it is still the same. Also, the previous connection was working over HTTPS as well. Just out of curiosity, what made you think it was insecure?

tsyrya avatar Mar 28 '22 07:03 tsyrya

Your initial screenshot shows Safari's address bar showing Not secure

davidzhao avatar Mar 28 '22 07:03 davidzhao

Ahh, I am sorry, I was wrong. But anyway with the example.livekit.io it didn't work as well :(

tsyrya avatar Mar 28 '22 07:03 tsyrya

interesting.. it's working well for me against our server. Can you share any debugging logs from mobile safari? here are instructions on how you could accomplish that.

davidzhao avatar Mar 28 '22 07:03 davidzhao

[Log] connecting to – "wss://livekit.test.appercode.com/rtc?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDk1MTY0MzksImlzcyI6IkFQSTlrRjNnQkNoaXRxV…" (2.972e1033.chunk.js, line 2)
"wss://livekit.test.appercode.com/rtc?access_token=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE2NDk1MTY0MzksImlzcyI6IkFQSTlrRjNnQkNoaXRxViIsImp0aSI6IlVzZXIgMSIsIm5iZiI6MTY0NjkyNDQzOSwic3ViIjoiVXNlciAxIiwidmlkZW8iOnsicm9vbSI6InJvb20xIiwicm9vbUpvaW4iOnRydWV9fQ.wJTg9gdoWYf8a9Orv6RRfDCl1QtcWGbr33l5Y0IkobM&sdk=js&version=0.17.1&protocol=6"
[Log] connected to Livekit Server version: 0.15.5, region:  (2.972e1033.chunk.js, line 2)
[Log] room event – "stateChanged" – "connected" (2.972e1033.chunk.js, line 2)
[Log] received server offer – "offer" – "stable" (2.972e1033.chunk.js, line 2)
[Log] sending answer (2.972e1033.chunk.js, line 2)

tsyrya avatar Mar 28 '22 08:03 tsyrya

That's it,the UI shows the error ("could not connect after timeout"). Might it be because the timeout too small and somehow it takes more time in safari to establish the connection?

tsyrya avatar Mar 28 '22 08:03 tsyrya

closing issue as it's stale. please file a new issue if problem persists.

davidzhao avatar Sep 15 '22 06:09 davidzhao