Disable idle/background throttling when using a CanvasCaptureMediaStream #733
Replies: 4 comments
-
This is primarily a Chrome issue https://bugs.chromium.org/p/chromium/issues/detail?id=1100746#c32, which has been fixed to an appreciable degree https://bugs.chromium.org/p/chromium/issues/detail?id=1145203. This is the specification issue re |
Beta Was this translation helpful? Give feedback.
-
Some tests for
Am interested in the results when the tab or window is not focused (note, flags or preferences can also impact media playback and capture, e.g., |
Beta Was this translation helpful? Give feedback.
-
Hey @guest271314 while this is a valid ask but is leading with a solution. It would be good to simply provide the usecases rather than a solution itself as certain areas this won't be possible or the way in which we'd be able to unlock the solution. |
Beta Was this translation helpful? Give feedback.
-
If you read the Chromium bug linked in this issue and speification issue you will see my use case. Which is how I encountered the bug: The specification does not state MediaStreamTrack should or must be muted when no user activity occurs. |
Beta Was this translation helpful? Give feedback.
-
Today, it's easily possible to build full live video mixers using existing APIs such as the
CanvasCaptureMediaStream
. However, the capability is crippled by the browser attempting to optimize canvas drawing andrequestAnimationFrame
timers. If the tab/window is backgrounded, drawing to the canvas stops and timers only run once per second. This happens in all common user agents.When a canvas is being captured, all of this throttling should be disabled.
If necessary, perhaps a permission/request can be made, similar to
WakeLock
.The only workaround for this today is to use pop-up windows for the UI. However, this has been proven to be less reliable, as browsers are starting to implement optimizations when the window is covered but not minimized. Additionally, if the user minimizes the window, everything stops. This is preventing the deployment of several video-related applications.
Beta Was this translation helpful? Give feedback.
All reactions