Bug 215161 - When the page enters the background, the mediastream video cannot be played in the pip window
Summary: When the page enters the background, the mediastream video cannot be played i...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: Mac macOS 10.15
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2020-08-05 02:42 PDT by 709922234
Modified: 2020-08-06 12:04 PDT (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 709922234 2020-08-05 02:42:57 PDT
Reproduce:
1. open https://mantou132.github.io/javascript-learn/stream.html
2. click pip button
3. Focus on other apps and let Safari enter the background

expect: The video plays smoothly in the pip window

actual: video paused

```
  const ctx = canvas.getContext('2d');
  const tick = () => {
    ctx.canvas.width = ctx.canvas.width;
    ctx.fillStyle = 'white';
    ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
    ctx.fillStyle = 'black';
    ctx.font = '50px serif';
    ctx.fillText(Math.floor(performance.now()), 0, 50);
    requestAnimationFrame(tick);
  }
  tick();
  const stream = canvas.captureStream();
  video.srcObject = stream;
  video.play();
  btn.onclick = () => video.requestPictureInPicture();
```
Comment 1 Radar WebKit Bug Importer 2020-08-06 12:04:56 PDT
<rdar://problem/66638598>