I am having problems while consuming the stream on Safari browser, the usecase is basically one to many broadcasting. The producer’s stream is a simulcast stream with three different encodings. Consumers get this stream when they are on google chrome browser. But when the consumers are on safari browser deviceRecvTransport.on(connectionstatechange) never gets called. I am not sure what i am doing wrong. Below is the code snippet of consumer’s side.
I just checked the ICE connection changes and DTLS changes of the transport on server, It is clearly visible the ice connection changes from connected — completed and also DTLS changes to connecting — connected.
I am not sure why the recvTransport.on(‘connectionstatechange’) on mediasoup client is not getting called. Also when i produce from same safari browser connectionstatechange listener gets called on sendTransport. is this issue due to not producing any tracks on consumer’s transport on safari browser?
Yes, That’s the point. If the ice state and dtls states are getting changed on the server correctly, does it not mean the transport.consume() method has already been called on the client side?
I am sure that i am consuming the video/audio producers. Also If i do not check the connectionstatechange but have a setTimeout in place to render the remote mediastream of the producer in video tag after a few seconds calling the recvTransport.consume(), i am able to see the stream of the producer.
I just enabled mediasoup client logs in my client application. I am attaching the screenshot of logs from chrome and safari for ice connection state changes.
Chrome Browser logs, where after consume() being called, descriptions are set and icestate change happened successfully.
Yes, i tested the demo app hosted on https://demo.mediasoup.org, It works perfectly fine.
My only concern is that, the server side transport’s connection state change is visible. But the clients side connection state changes are not happening at all. I do not even know what to debug here, cause we call the mediasoup client api and the api manages the peerconnection.
I would request you to suggest me something over here.
Yes, i totally agree to what you had shown. As of now i am using mediasoup-client version 3.2.0. I will switch to the latest version and will see if that works for me.
Thanks alot for all the quick responses you give us on the forum. I will get back to you after testing with latest mediasoup-client.
Just an update here… Safari has a different kind of auto-play policy than chrome. If we just want to subscribe to a stream without producing audio/video. The stream would not playback by itself. Therefore it is necessary to call getusermedia and allow the access atleast to mic, by giving permission to mic the stream starts to play.