opentok-react-native icon indicating copy to clipboard operation
opentok-react-native copied to clipboard

Disconnect camera hardware

Open op opened this issue 4 years ago • 4 comments

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?

op avatar Aug 14 '19 09:08 op

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!

op avatar Aug 14 '19 12:08 op

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 avatar Aug 23 '19 16:08 ggoldens

@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?

op avatar Aug 27 '19 06:08 op

Is this not possible? I am trying to add buttons to

  • Toggle mute
  • Toggle speaker
  • Toggle video
  • Toggle front-facing camera/back-facing camera

freddiecabrera avatar Jun 11 '20 00:06 freddiecabrera