When toggle video close, not became rtcview black screen and not close green light on the iphone. how can i fix this

when toggle video close, not became rtcview black screen and not close green light on the iphone. how can i fix this.

if i set new media with video false. like this.

mediaDevices.getUserMedia({
audio: true,
video: false,
});

video is required.

my toggle video function bellow.
localStream.getVideoTracks().forEach(track => {
track.enabled = !track.enabled;
});

I’m not entirely sure what you mean.
Also you can do.

localStream.getAudioTracks().forEach(track => {
  track.enabled = !track.enabled;
});

When the iphone camera is on, the green light is on where the camera is.

the code you sent. it will be only audio disabled or enabled.

what I want. when i toggle video: false. The video does not close, only the last frame freezes.

Sounds like you’d only manage to accomplish the desired result by adding and removing the video track on demand along with possibly performing some re-negotiation steps, otherwise the WebRTC module will hold onto the camera and as such the camera will always be active but paused.