This is a work in progress in hopes to close the following issue #566
Just adding onRecordingStarted and onRecordingStopped would have been sufficient in most cases, but, based on Twilio documentation for onRecordingStarted, it looks like it would not cover the case for joining a room that is already being recorded. (In cases of group rooms)
This method is only called when a Room which was not previously recording starts recording. If you've joined a Room which is already recording this event will not be fired.
One way to fix this would be to emit onRecordingStarted event manually on onConnected if room.isRecording() == true
I was also looking into adding isActive() method to the TwilioVideo component, but once I checked the current communication setup in the project, I noticed that there's no Promise based communication between the CustomTwilioVideoViewManager and the react-native code.
I looked into a possible solution inside react-native-camera module since I knew it had a promise-based API for communication with the CameraView, so I wrote the TwilioVideoModule to allow communication with the UI layer
This solution turned out to be working, but it the only the first time you start the video call. After starting the call for the second time I could not reach out to the CustomTwilioVideoView since the view was not properly destroyed previously and resources were not released it seems.
With a bit of help from sir @marqroldan and his PR, the view is properly destroyed
The whole purpose of this PR is not just to add the recording callbacks, but to actually establish a better solution for communicating with the UI layer.
I will flag this as a WIP since it still lacks iOS implementation, but any feedback is welcome on the abovementioned topics!
This is a work in progress in hopes to close the following issue #566
Just adding
onRecordingStarted
andonRecordingStopped
would have been sufficient in most cases, but, based on Twilio documentation foronRecordingStarted
, it looks like it would not cover the case for joining a room that is already being recorded. (In cases of group rooms)One way to fix this would be to emit
onRecordingStarted
event manually ononConnected
ifroom.isRecording() == true
I was also looking into adding
isActive()
method to theTwilioVideo
component, but once I checked the current communication setup in the project, I noticed that there's noPromise
based communication between theCustomTwilioVideoViewManager
and thereact-native
code.I looked into a possible solution inside
react-native-camera
module since I knew it had a promise-based API for communication with theCameraView
, so I wrote theTwilioVideoModule
to allow communication with the UI layerThis solution turned out to be working, but it the only the first time you start the video call. After starting the call for the second time I could not reach out to the
CustomTwilioVideoView
since the view was not properly destroyed previously and resources were not released it seems.With a bit of help from sir @marqroldan and his PR, the view is properly destroyed
The whole purpose of this PR is not just to add the recording callbacks, but to actually establish a better solution for communicating with the UI layer.
I will flag this as a WIP since it still lacks iOS implementation, but any feedback is welcome on the abovementioned topics!
Thanks