-
Notifications
You must be signed in to change notification settings - Fork 28
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
Should mute and unmute events of MediaStreamTrack be allowed to fire based on user non-action? #141
Comments
Does this happen due to screen saver or lock screen, or does it happen even though the screen is on and unlocked? |
No screen locks. A challenging bug to narrow down. Only when used |
First attached |
Arrived at this bug after attempting hundreds of times to capture 7:42 of video to merge in a |
@henbos Interestingly, cannot reproduce the bug where
Chromium froze twice today trying to reproduce the issue. Will re-open this issue if am able to retrace steps and reproduce the issue. |
@henbos Reviewed code that tested and isolated the case where Steps To Reproduce: Open console, run the following code, click on the window, then move the mouse pointer back to the open console.
Tested at two separate sites, If the cursor is moved to the active document unmute event is fired, then the
|
To capture the steps to reproduce demonstrating effect of non-user action and user action used the same code at Firefox to capture Chromium procedure. The first two videos the result is consistent at different domains. The last video the cursor is moving on the active document, delaying the
|
The issue occurs when capturing "Your Entire Screen", "Application Window" or "Chromium Tab", not just "Chromium Tab". The video track simply abruptly goes mute in 4 seconds at Chromium 85.0.4173.0, where
|
Removing
does not fire |
"internal" Chromium code is at least one of the causes of this bug. Chromium "User Activation" project marked their side of the bug as
What appears to be meant is for Screen Capture implementers at Chromium to unequivocally remove the internal Chromium User Activation code from this API, by brute force if necessary. |
We could list examples where the user agent might want to mute or unmute without user interaction to clarify. For example a call is being received on a mobile device, screensaver is starting, etc. |
I propose we add clarifying language similar to mediacapture-main. |
However the proposal "should not be fired based on user non-action" is not accepted by the working group. |
Changed the title to reflect the discussion rather than the conclusion |
Do not file issues here for the purpose of being accepted. Reject your conclusion that user-action should be massaged into the specification based on Chromium bug. The issue is filed to precisely reach that conclusion. Chromium has implemented said conditions for "Tab" capture and "Application" capture which caused numerous downstream issues. Thus, changes have recently been made to at least try to correct the issue https://bugs.chromium.org/p/chromium/issues/detail?id=1100746#c32. |
Consider the concrete use case of capturing a primary source document, in this case an historic document Denying Free Blacks the Right to Vote (1724, 1735), and adding an audio track that reads the document, to reproduce the primary resource, without addition or subtraction. Use technologies shipped with the browser, After multiple attempts to record the document with audio track, found that Chromium was firing For this use case including animation in the document to satisfy Chromium muting the track when no activity on renderer is spurrious. The requirement is to reproduce primary source documents precisely by audio and visual tracks as a single media, not to create activity on the page that is not remotely related to reading the document by means of sight and sound. The track from The user must expect the capture of application and tab to be captured in same algorithm steps as entire screen capture; same frame rate, until instructed to do otherwise. Downstream what happens what a Toggling mute and unmute of |
I wouldn't expect tracks to be muted and unmuted sporadically for no apparent reason, but I would expect there to be legitimate use cases where a track gets muted without user interaction, such as if the screen gets locked due to inactivity. |
@henbos The screen lock theory fails when then user specifically configures the OS to not suspend or lock the screen due to inactivity; see w3c/mediacapture-main#670 (comment), w3c/mediacapture-main#668 (comment). Even if the theory of default settings of a machine suspending or locking the screen without user activity were to be seriously explored we would need to test all devices to determine what really occurs, which is not practical and ecludes the very real possibility that the user has changed default settings that this specification has no way of observing all of the possible OS and hardware configuration. I could have several cameras connected to a machine using |
The concrete use case described is for a very brief screen capture of a screen displaying a primary resource, four (4) total pages of primary resource material. Consider creating a video of Dred Scott v. Sandford, 60 U.S. (19 How.) 393 (1857), which is well over 100 pages. I do not need to concern myself with |
Is Chrome muting the track due to inactivity even though there is no screen saver, lock screen or screen turning off, etc? |
Chromium is muting the track when there is no activity on the rendering thread. The way I see it, I had to move the mouse in order for the track to not mute. Since cursor never constraint does not work have to set cursor to none at the video. The muting occurred at 1 second. That is not specified, obviously. Of course that means that |
The muting occurs only at "Tab" and "Application" capture, not "Entire screen" capture. Tab and application capture should behave the same as entire screen capture or |
Muting within a second definitely sounds like an implementation bug. Does it work as long as you move the mouse and gets muted as soon as you stop moving the mouse, or is this an issue about it always muting when you try to record it? |
Have to head off to a gig. Will post results of experiments after the change later today or tomorrow. |
I don't need to read 100 pages of Dred Scott v. Sandford, 60 U.S. (19 How.) 393 (1857) to figure out that muting a track within a second is a bug. I think Chromium implementers can follow up on fixing this issue based on their priorities. That is not a spec issue. Here on the spec side of things, it is enough to add a clarifying section similar to https://w3c.github.io/mediacapture-main/getusermedia.html#life-cycle-and-media-flow. |
This is editorial and ready for PR |
I'm still reading through the thread and following all the links. I'm currently making my way through |
This issue appears to have a non-trivial amount of unwritten history. @jan-ivar, could you please add the clarifying language which you suggest, or otherwise advise what was agreed upon? |
We seem to already have such a section in https://w3c.github.io/mediacapture-screen-share/#hidden-display-surfaces. I'll try adding a note to it. |
The specification uses the term "user activation" exactly once
The terms "user action" and "user gesture" are not included in the language of the specification.
Chromium 85 appears to fire
mute
andunmute
events onMediaStreamTrack
fromgetDisplayMedia()
directly corresponding to user non-action, for example, not moving the cursor on the captured screen, or user action, moving the cursor on the captured screen.The result is a series of unintended consequences impacting other API's, including media file produced by
MediaRecorder
,timeupdate
event ofHTMLMediaElement
not firing every 50 to 250ms per HTML Standard. The resulting bugs that have observed so far downstream https://bugs.chromium.org/p/chromium/issues/detail?id=1099280.Kindly include language in the specification which prohibits implementations from firing
mute
andunmute
events based on user non-action or user action.The text was updated successfully, but these errors were encountered: