No video shown with RTCMTLVideoView in WebRTC iOS framework

236 views
Skip to first unread message

Sergey Zagoruyko

unread,
Apr 15, 2023, 9:19:23 AM4/15/23
to discuss-webrtc

I am trying to integrate WebRTC Video into my iOS app. I downloaded the source code from https://webrtc.github.io/webrtc-org/native-code/ios/ and built it successfully. However, GLView is not supported in this codebase, so I had to use MetalKit and added RTCMTLVideoView to my class. I also added RTCVideoRenderer and RTCVideoViewDelegate and set self.metalVideoView.delegate = self.

When the method to handle incoming video is called, I can see that the object received from the notification is RTC_OBJC_TYPE(RTCMediaStreamTrack): video janusv0 enabled Live, and VideoTracks count is: 1. However, I am not able to see any video on the screen. Instead, I just see a blank screen. In the previous version of WebRTC, I used GLView with the same implementation and it worked fine.

Could someone provide an example of a WebRTC implementation in iOS that uses MetalKit?
This is my snippet on Pastebin:


Artiom Khachaturian

unread,
Apr 20, 2023, 9:06:28 AM4/20/23
to discuss-webrtc
Check dimensions of video view, maybe is empty, example is here: https://webrtc.googlesource.com/src/+/refs/heads/main/examples/objc/AppRTCMobile/ios
Reply all
Reply to author
Forward
0 new messages