Cannot see Video nor Audio in Safari. However, data channels work.

Hi,

In my setup, I have a send transport and recv transport on client side, connected to webrtc transports on the server. On both transports, I have a data channel, and data is flowing fine for both. However, I also have a video consumer on my recv transport, but I cannot get video or audio playback. This is only with Safari. Works on Chrome and Firefox.

I have seen the Safari autoplay posting, and I don’t think that applies to my situation, I don’t require autoplay. Manual play button is enough for me.

Oddly, on Safari: If I make the video element go into picture-in-picture mode and then back to regular, I can see a glimpse of the video for a split second.

Does anybody have any idea what might be causing this problem?

Thanks!

Ian

Safari 13.1
MediaSoup v3

I have found the issue. Adding a media track to a mediastream that is already attached to an HTMLVideoElement does not work in Safari. What you want to do is, create a new media stream, add the mediatrack (provided by the consumer) and then attach the mediastream to the HTMLVideoElement. This is how it’s done in the mediasoup demo and it works.

This only seems to be an issue for Safari.

2 Likes

Hi! I stuck on the same problem, but I cannot see that your solution works for me. May be I did something wrong? Could you paste your code flow about MediaStream working, please?