react-native-webrtc / react-native-webrtc

The WebRTC module for React Native
https://react-native-webrtc.discourse.group
MIT License
4.58k stars 1.23k forks source link

Exception thrown while executing UI block: -[RTCVideoView setOnClick:]: unrecognized selector sent to instance #1595

Closed rcidt closed 2 weeks ago

rcidt commented 1 month ago

This error is thrown in recent React Native versions (I'm on 0.74.3) when you wrap a video view within a touchable component.

The following patch resolves this issue:

diff --git a/node_modules/react-native-webrtc/ios/RCTWebRTC/RTCVideoViewManager.m b/node_modules/react-native-webrtc/ios/RCTWebRTC/RTCVideoViewManager.m
index c0c0f51..25cb54f 100644
--- a/node_modules/react-native-webrtc/ios/RCTWebRTC/RTCVideoViewManager.m
+++ b/node_modules/react-native-webrtc/ios/RCTWebRTC/RTCVideoViewManager.m
@@ -357,6 +357,10 @@ - (void)videoView:(id<RTCVideoRenderer>)videoView didChangeVideoSize:(CGSize)siz
     }
 }

+- (void)setOnClick:(RCTDirectEventBlock)onClick {
+    // Resolves "Unrecognized Selector" error on RN 0.74.3
+}
+
 @end

 @implementation RTCVideoViewManager

Platform Information

saghul commented 1 month ago

That bug should be solved in https://github.com/react-native-webrtc/react-native-webrtc/pull/1588 which is part of version 124.0.3.