blackuy / react-native-twilio-video-webrtc

Twilio Video (WebRTC) for React Native
MIT License
606 stars 403 forks source link

Issue with flipCamera() function not working when registering CallScreenActivity through AppRegistry in React Native Twilio Video project #743

Open Muhammadkaleem opened 3 months ago

Muhammadkaleem commented 3 months ago

I'm encountering an issue with the flipCamera() function in my React Native Twilio Video project. The function works fine when CallScreenActivity is navigated to, but it fails to work when registered directly through AppRegistry.

Problem

When registering CallScreenActivity through AppRegistry using the following code:

AppRegistry.registerComponent('full_screen', () => CallScreenActivity);

the flipCamera() function does not work as expected. Upon invoking flipCamera(), the camera does not flip, and there's no change in the camera view.

Background: I'm using the react-native-twilio-video-webrtc package for Twilio Video functionality. The camera permission is properly set, and the flipCamera() function works as expected when CallScreenActivity is navigated to directly.

Verified Things

  1. Checked camera permissions, which are properly set.
  2. Ensured that Twilio Video setup is consistent between direct navigation and registration.
  3. Reviewed activity lifecycle and ensured flipCamera() is called after full initialization.
  4. Tested on multiple devices to verify consistency.

Expected behaviour

The flipCamera() function should work properly when CallScreenActivity is registered through AppRegistry, just like it does when navigated to directly.

Environment

react-native-twilio-video-webrtc

Version: 3.2.0

lylysunshinee commented 2 months ago

Same issue in android