RTCMTLVideoView on iOS freezes for few seconds then unfreezes.

Skip to first unread message

Ross Stepanyak

Jul 20, 2021, 2:41:48 PMJul 20
to discuss-webrtc
I'm using google webrtc from cocoapod (1.1.31999) and experience a weird issue when video of the remote participant freezes for a while then unfreezes.

I'm logging every frame and see that
func renderFrame(_ frame: RTCVideoFrame?) stops firing for a while even though other remote video views are fine.

It happens frequently when there are more than 2 participants with video on. 

The code I use to add video track is pretty usual:

class RemoteVideoView: UIView {
   private var currentVideoTrack: RTCVideoTrack? 

   var rtcVideoView: RTCMTLVideoView = { 
      let rtcVideoView = RTCMTLVideoView()       
      rtcVideoView.translatesAutoresizingMaskIntoConstraints = false return rtcVideoView

   func update(with videoTrack: RTCVideoTrack?) { 
        currentVideoTrack = videoTrack 
        rtcVideoView.contentMode = .scaleAspectFit videoTrack?.add(rtcVideoView)

Any thoughts are appreciated
Reply all
Reply to author
0 new messages