Closed Bug 1681718 Opened 5 years ago Closed 3 years ago

Play/Pause button in PiP window and media controls do not work on twitch while the Firefox window is minimized

Categories

(Toolkit :: Picture-in-Picture, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME
Tracking Status
firefox83 --- affected
firefox84 --- affected
firefox85 --- affected
firefox100 --- fixed

People

(Reporter: ailea, Unassigned)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [fidefe-MR1-2022])

Tested with:

Nightly 85.0a1 (2020-12-10)
Beta 84
Release 83.0

Tested on:

Windows 10
Windows 7
MacOS Big Sur 11

Steps:

  1. Launch firefox and access: https://www.twitch.tv/
  2. Choose any video/stream and toggle the PiP window
  3. Minimize the Firefox window
  4. Click pause/play in the PiP window

Actual result:

The play button from the PiP window doesn't work anymore after the user clicks the pause button, while the Firefox window is minimized.

Expected result:

Play PiP window button should work properly and the user should be able to play/pause the video in PiP window.

Regression range:

Will look for the regression range asap.

Severity suggestion: S3

I wonder if this is twitch-specific. I can repro with twitch, but not on youtube. However, I see the same thing with media controls - pausing works but playing doesn't work when the page is minimized.

Alastor, do you know what might cause that?

Component: Video/Audio Controls → Audio/Video: Playback
Flags: needinfo?(alwu)
Product: Toolkit → Core
Summary: Play/Pause PiP window button does not work while the Firefox window is minimized → Play/Pause button in PiP window and media controls do not work on twitch while the Firefox window is minimized

When I see this issue, here is the log I capture.

[Child 1187981: Main Thread]: D/nsMediaElement 0x7fa4e2913800 Play() called by JS readyState=1
[Child 1187981: Main Thread]: D/nsMediaElement 0x7fa4e2913800 created PlayPromise 0x7fa339eafec0
[Child 1187981: Main Thread]: D/nsMediaElement MediaElement 0x7fa4e2913800 UpdateReadyStateInternal() NEXT_FRAME_UNAVAILABLE_SEEKING; Forcing HAVE_METADATA
[Child 1187981: Main Thread]: D/nsMediaElement 0x7fa4e2913800 Pause() called by JS
[Child 1187981: Main Thread]: D/nsMediaElement MediaElement 0x7fa4e2913800 UpdateReadyStateInternal() NEXT_FRAME_UNAVAILABLE_SEEKING; Forcing HAVE_METADATA
[Child 1187981: Main Thread]: D/nsMediaElement PlayPromise 0x7fa339eafec0 rejected with 0x806e0001 (PauseAbortErr)
JavaScript error: , line 0: AbortError: The fetching process for the media resource was aborted by the user agent at the user's request.

After we call play via play button on PIP window, website's script calls pause following by. I think that is related with the visibility issue, because in current spec, when using video in PIP window, the page visibility would be invisible so website can't distinguish between "playing a background invisible video" and "playing a visible video via PIP window". So this issue seems to me that Twitch explicity pauses the video because they think video is invisible to users.

We've encoutered similar issues where website would lower its video resolution after playing video in PIP window for a while. Before we tackle PIP window as a factor into the spec of document visibility, maybe the patch in bug1598654 can help this.

Flags: needinfo?(alwu)
See Also: → 1598654

I'm not sure what we can do here, because I think the issue is caused by website pausing media due to the hidden page.


Hi, Mike, Do you have any idea about this issue? Will your patch in bug1598654 help in this one?
Thank you.

Severity: -- → S3
Flags: needinfo?(mconley)

(In reply to Alastor Wu [:alwu] from comment #3)

I'm not sure what we can do here, because I think the issue is caused by website pausing media due to the hidden page.

Right, I think one fix would be to not mark the page hidden if there's a pip window open... but I don't know how straightforward that'd be.

(In reply to :Gijs (he/him) from comment #4)

Right, I think one fix would be to not mark the page hidden if there's a pip window open... but I don't know how straightforward that'd be.

There are some discussions in bug1598654 (comment5~7) where DOM team has some concerns about simply marking page as visible.

Component: Audio/Video: Playback → Picture-in-Picture
Product: Core → Toolkit

Sorry for the looooong delay. Yes, it's possible that bug 1598654 would help with this - although the patch in there never landed.

Flags: needinfo?(mconley)
Priority: -- → P3
Whiteboard: [fidefe-MR1-2022]
Blocks: 1742457

As a result of Bug 1755748 having landed (which happens to fix Bug 1598654), I can't reproduce this bug on MacOS.

I can't reproduce this on Windows 11 either. I think we can call it here.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → WORKSFORME
Depends on: 1755748
Blocks: 1772335
No longer blocks: 1772335
You need to log in before you can comment on or make changes to this bug.