logo
On this page

Why is the camera indicator light still on after disabling your own video on the web page?

2021-09-09
Products / Plugins:Video Call / Audio Call / Live streaming
Platform / Framework:Web

Problem Description

When using ZEGOCLOUD Express Web SDK, after successfully disabling your own video by calling the mutePublishStreamVideo interface, the camera indicator light is still on.

Problem Cause

ZEGOCLOUD Express Web SDK does not support turning on/off video capture separately. Calling the mutePublishStreamVideo interface to close the video being streamed actually only sets the "MediaStreamTrack.enabled" property to "false". After calling this interface, it still sends black video frames and does not close video capture, so the camera indicator light will not turn off.

Solution

Call the destroyStream interface to destroy the video stream to close video capture, and the camera indicator light will turn off. However, since the object pushed by the SDK is a stream containing both audio and video tracks, destroying the stream will affect both audio and video. Therefore, when calling the destroyStream interface, it will simultaneously revoke access to both the camera and microphone, that is, close the capture of both audio and video.

Previous

How to set landscape orientation when publishing streams in mini programs?

Next

Why can't I adjust background music volume through the system volume?

On this page

Back to top