opentok-react-native
opentok-react-native copied to clipboard
Disconnect camera hardware
Feature Request
Description
Expose a way to disconnect the camera. You can set publishVideo
to stop the publishing of the video. The camera will still be allocated.
The root issue we're trying to solve is to release the camera when someone locks their phone. This to allow Android users to continue to use eg the iris scanner to unlock their phone.
Proposal
You can set videoTrack
on initialise. Allow this to be set while running?
I played around with removing the OTPublisher
and adding it back but it didn't work. Giving up now.
It would be amazing to have a way to control the allocation of the hardware too!
Hi @op, sorry for the late reply. I just tested it like this: <OTSession .....> {this.state.showPublisher && <OTPublisher style={{ width: 600, height: 480 }} />} </OTSession/ > If showPublisher is false, the OTPublisher is not being renderer and the publisher stream is destroyed. If you re-render it again, it will create the publisher.
Can you confirm if you see the same?
@ggoldens Thanks! That's what I tried but it disconnects the user from the stream. I'm looking for a way to turn the camera off but leave the audio on.
Is there a way to update the videoTrack
property?
Is this not possible? I am trying to add buttons to
- Toggle mute
- Toggle speaker
- Toggle video
- Toggle front-facing camera/back-facing camera