Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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