Bug 242679
| Summary: | [macOS] Canvas.getContext('2d').drawImage on a camera video stream does not work when tab is backgrounded | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | youenn fablet <youennf> |
| Component: | Media | Assignee: | youenn fablet <youennf> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | ansarman, dino, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
youenn fablet
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.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/96937033>
youenn fablet
This bug was externally reported.
Anastasiya Sarmant
The canvas stops streaming when the tab becomes inactive.
youenn fablet
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.
youenn fablet
Pull request: https://github.com/WebKit/WebKit/pull/2655
EWS
Committed 252738@main (de9dae2e5319): <https://commits.webkit.org/252738@main>
Reviewed commits have been landed. Closing PR #2655 and removing active labels.