Janus stream freezes on iOS devices (hybrid app with Capacitor)

Hi all,

We have a very weird problem. We’ve searched all over the place but can’t find the cause or solution.
Here’s a brief description;

On any device we can start a WebRTC video stream with ‘getUserMedia()’ this works fine. When we’re
on the receiving end we assign the stream to a video tag and it shows the live broadcast.
This works fine on Android and Web, but on iOS this stream freezes, sometimes in the first second, sometimes after 10 seconds, sometimes after a minute.

<video
	#videoElement
	[srcObject]="myVideoStream"
	controls
	autoplay
	playsinline
	webkit-playsinline></video>

When, in Angular, logging events on the videoPlayer, we never receive ANY errors.
We’ve tried manually and programmatically executing pause() and play() but then the frozen screen just disappears and we see an empty video player.
Correct answer (cause + solution) will be awarded €1000,-

The MediaStream.GetVideoTracks() function still logs a correct stream, the websocket is still alive… nothing logs any errors.
Even if I watch the same stream on any other device, I’m seeing that it’s actually still up & running.

We’ve tried to re-assign the stream after it freezes (with a button click):

this.videoElement.nativeElement.srcObject = this.myVideoStream;

Also tried to pause it first, or pause() and load() and play(), but nothing seems to work.
The only thing that works so far, is to refresh the whole service, setup a new websocket and assign the new MediaStream to the [srcObject] which will then freeze again after a short amount of time.

I’m starting to think that iOS itself decides to ‘disable’ the view?
Because there’s no other indication of any errors in the MediaStream, the VideoTracks, the Websocket or the VideoPlayer.

Does anyone has some other possible solutions?
And also… maybe a possible way to find the cause?
Because without ‘noticing’ when it goes wrong, we can’t restart the stream.
Right now a user has to click a manual ‘reconnect’ button every few moments.

Maybe I need to change the codec to something else?

Thanks in advance!

Have you checked if it’s the PeerConnection itself that dies, possibly because of ICE changes? You can inspect the state of a handle (and its PeerConnection) using the Admin API.

@DCWolf is this resolved?