Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
toggleVideo = () => {
const showVideo = !this.state.showVideo
this.setState({
showVideo
})
if (showVideo) {
RtcEngine.enableVideo()
RtcEngine.startPreview()
} else {
RtcEngine.disableVideo()
RtcEngine.stopPreview()
}
}