cordova-rtc / cordova-plugin-iosrtc

Cordova iOS plugin exposing the WebRTC W3C API
MIT License
690 stars 338 forks source link

stream.getVideoTracks()[0].enabled should blank off the stream? #449

Open derMani opened 4 years ago

derMani commented 4 years ago

Expected behavior

getVideoTracks()[0].enabled = false

should blank off the screen (just sending a black image). Ideal for muting the camera. Same behavior can be seen with webrtc in chrome

Observed behavior

getVideoTracks()[0].enabled = false

just pauses/freezes the screen. The last video frame can be seen

Steps to reproduce the problem

Create a stream with getUserMedia and attach it to a video element

Set

stream.getVideoTracks()[0].enabled

to false

Platform information

hthetiot commented 4 years ago

We would need to clear the texture buffer to be blank instead of last frame.

Im not considering that a bug. I will see what I can do.

derMani commented 4 years ago

Cool and thanks! Hint: In previous versions (< 5.x) the video was black when enabled was set to false.

Maybe you can somehow reuse the code there.

hthetiot commented 4 years ago

@derMani this part of the implementation did not change, WebRTC.framework did however, so that might be where the issue lies. Thx for input.

yangjingyu commented 4 years ago

I had the same problem, the stream stuck in the last frame

hthetiot commented 4 years ago

Related https://github.com/cordova-rtc/cordova-plugin-iosrtc/pull/427

oscarvadillog commented 4 years ago

I have tested #427 and the video is paused when getVideoTracks()[0].enabled = false

hthetiot commented 4 years ago

I may have an idea, I may disable rendering all together when enabled false.

oscarvadillog commented 3 years ago

Hey @hthetiot, any update on this? ❤️

hthetiot commented 3 years ago

lol nope @oscarvadillog

Bamasdf commented 7 months ago

@hthetiot Is there any update on this?