1. Load https://jsfiddle.net/eq5upzh6/. 2. Grant prompt 3. Once the camera starts, switch to another tab and change what the camera captures. 4. Wait 6 seconds 5. Switch back to the JSFiddle tab. One of the canvas (canvas1) stayed to a camera frame just before the switch to the other tab. We would expect canvas1 to keep being updated even when the other tab is backgrounded.
<rdar://problem/96937033>
This bug was externally reported.
The canvas stops streaming when the tab becomes inactive.
In the jsfiddle, the video element is not playing any audio and might be paused when page goes to background. One way to prevent it is to add a silent audio track. For instance https://jsfiddle.net/0h5edpLw/. This raises the question of what happens to media elements which get paused as not visible+silent while they are repeatedly drawn to canvas. In a sense, these media elements are visible so we should probably not pause them.
Pull request: https://github.com/WebKit/WebKit/pull/2655
Committed 252738@main (de9dae2e5319): <https://commits.webkit.org/252738@main> Reviewed commits have been landed. Closing PR #2655 and removing active labels.