Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enabled=false MediaStreamTrack handling for HTMLVideoElement #961

Open
youennf opened this issue May 11, 2023 · 2 comments
Open

enabled=false MediaStreamTrack handling for HTMLVideoElement #961

youennf opened this issue May 11, 2023 · 2 comments

Comments

@youennf
Copy link
Contributor

youennf commented May 11, 2023

The spec is light in terms of how enabled=false tracks should be handled by HTMLMediaElement.

There are a few behavioural changes that are worth tightening:

  1. Should rvfc callbacks be called for each frame of an enabled=false tracks?
    From testing, it appear rvfc callbacks are called for both Chrome and Safari. It seems though that if all tracks are enabled=false, UA may stop camera and callbacks would no longer be called. It might be more deterministic if rvfc is never called for an enabled=false track.
  2. Should change of video frame size alter the media element size? Chrome, Safari and Firefox seem to update the size.
  3. What should videoWidth/videoHeight return? Chrome and Safari seem to return the latest frame size, Firefox returns 1.
@jan-ivar
Copy link
Member

jan-ivar commented Jun 6, 2023

It seems though that if all tracks are enabled=false, UA may stop camera and callbacks would no longer be called.

Why would callbacks stop? The spec says "A muted or disabled MediaStreamTrack renders either silence (audio), black frames (video), or a zero-information-content equivalent." This seems accomplishable without hardware.

It says frames plural, but doesn't specify frequency. As long as we emit black frames, shouldn't VF callbacks happen?

Somewhat analogous perhaps is w3c/webrtc-encoded-transform#185.

@youennf
Copy link
Contributor Author

youennf commented Jun 6, 2023

Why would callbacks stop?

Currently, the callbacks are called for each new video frame generated by the camera (even though the frame is then turned into black).
When camera is off, there is no longer any frame being produced. The browser could of course call rvfc from time to time, to emulate this but at which frame rate? And for which purpose?

The thing is that whether the camera is off or not becomes observable to web pages.
This does not seem great and may lead to compat issues if we do not define something more precise.

It says frames plural, but doesn't specify frequency. As long as we emit black frames, shouldn't VF callbacks happen?

rvfc exposes the black frames behaviour of UA that is otherwise not observable to the web page or the user.
It seems good to make this behaviour interoperable.

Ditto for stats counter somehow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants