From 15eb857c4954f45a1b061ab9f07aae2c31991e7f Mon Sep 17 00:00:00 2001 From: Santhosh Vaiyapuri Date: Tue, 17 Feb 2026 18:02:01 +0100 Subject: [PATCH] feat(ios): improved frame rendering ref: https://github.com/GetStream/webrtc/pull/70 --- ios/RCTWebRTC/RTCVideoViewManager.m | 7 ++++--- ios/RCTWebRTC/WebRTCModule.m | 2 ++ stream-react-native-webrtc.podspec | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ios/RCTWebRTC/RTCVideoViewManager.m b/ios/RCTWebRTC/RTCVideoViewManager.m index a1b74e33b..2d660b90d 100644 --- a/ios/RCTWebRTC/RTCVideoViewManager.m +++ b/ios/RCTWebRTC/RTCVideoViewManager.m @@ -8,7 +8,7 @@ #if TARGET_OS_OSX #import #else -#import +#import #endif #import #import @@ -67,7 +67,7 @@ @interface RTCVideoView : RCTView #if TARGET_OS_OSX @property(nonatomic, readonly) RTCMTLNSVideoView *videoView; #else -@property(nonatomic, readonly) RTCMTLVideoView *videoView; +@property(nonatomic, readonly) RTCVideoRenderingView *videoView; #endif /** @@ -124,7 +124,8 @@ - (instancetype)initWithFrame:(CGRect)frame { subview.wantsLayer = true; _videoView = subview; #else - RTCMTLVideoView *subview = [[RTCMTLVideoView alloc] initWithFrame:CGRectZero]; + RTCVideoRenderingView *subview = [[RTCVideoRenderingView alloc] initWithFrame:CGRectZero]; + subview.renderingBackend = RTCVideoRenderingBackendSharedMetal; _videoView = subview; #endif [self addSubview:self.videoView]; diff --git a/ios/RCTWebRTC/WebRTCModule.m b/ios/RCTWebRTC/WebRTCModule.m index da9a335a2..acace36c3 100644 --- a/ios/RCTWebRTC/WebRTCModule.m +++ b/ios/RCTWebRTC/WebRTCModule.m @@ -111,6 +111,8 @@ - (instancetype)init { audioProcessingModule:nil]; } + _peerConnectionFactory.frameBufferPolicy = RTCFrameBufferPolicyConvertWithPoolToNV12; + _rtcAudioDeviceModuleObserver = [[AudioDeviceModuleObserver alloc] initWithWebRTCModule:self]; _audioDeviceModule = [[AudioDeviceModule alloc] initWithSource:_peerConnectionFactory.audioDeviceModule delegateObserver:_rtcAudioDeviceModuleObserver]; diff --git a/stream-react-native-webrtc.podspec b/stream-react-native-webrtc.podspec index 4f79503bf..29e707b5d 100644 --- a/stream-react-native-webrtc.podspec +++ b/stream-react-native-webrtc.podspec @@ -21,7 +21,7 @@ Pod::Spec.new do |s| s.swift_version = '5.0' s.dependency 'React-Core' # WebRTC version from https://github.com/GetStream/stream-video-swift-webrtc releases - s.dependency 'StreamWebRTC', '~>137.0.54' + s.dependency 'StreamWebRTC', '~>137.0.62' # Swift/Objective-C compatibility #https://blog.cocoapods.org/CocoaPods-1.5.0/ s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES'