If the tab which PIP video belongs to is in the background, then resuming PIP video won't request wakelock
Categories
(Core :: Audio/Video: Playback, defect, P3)
Tracking
()
People
(Reporter: whimboo, Assigned: alwu)
References
(Blocks 2 open bugs)
Details
Attachments
(3 files)
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
47 bytes,
text/x-phabricator-request
|
RyanVM
:
approval-mozilla-beta+
|
Details | Review |
Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:85.0) Gecko/20100101 Firefox/85.0 ID:20201121092754
Usually when watching movies in fullscreen the timer to put the machine into sleep / hibernation is getting ignored, and the machine stays active. This behavior is not the case when watching a video in a fullscreen picture-in-picture window.
Comment 1•3 years ago
|
||
Hey alwu, is this something that bug 1659060 should have fixed?
Assignee | ||
Comment 2•3 years ago
|
||
Yes, it should be fixed already by bug 1659060, but that would only be true if video is playing.
I checked the latest Nightly, we did request the screen wakelock for playing PIP video, so I were not able to reproduce this issue. I tested it on MacOS 10.14 and 11.0.
Henrik,
So you computer goes to sleep mode even if you're playing a PIP video? Or you just put the video in PIP mode, but didn't play it?
Would you mind to show me the result from running pmset -g assertions
when you're playing PIP video?
Thank you.
Reporter | ||
Comment 3•3 years ago
|
||
Hm, when running this command I can clearly see Firefox listed:
pid 66601(firefox): [0x0010d0f600019f5b] 00:00:02 NoIdleSleepAssertion named: "audio-playing"
pid 66601(firefox): [0x0010d0f600059f5c] 00:00:02 NoDisplaySleepAssertion named: "video-playing"
``
Not sure what actually happened at that time so let me close this bug as incomplete, and I will reopen again if I can see it again.
Reporter | ||
Comment 4•3 years ago
|
||
I just had the problem again with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:84.0) Gecko/20100101 Firefox/84.0 ID:20201122152513
Here the output again:
➜ pmset -g assertions
2020-12-11 14:10:42 +0100
Assertion status system-wide:
BackgroundTask 0
ApplePushServiceTask 0
UserIsActive 1
PreventUserIdleDisplaySleep 0
PreventSystemSleep 0
ExternalMedia 0
PreventUserIdleSystemSleep 1
NetworkClientActive 0
Listed by owning process:
pid 171(hidd): [0x00164f8e000989b6] 00:00:00 UserIsActive named: "com.apple.iohideventsystem.queue.tickle serviceID:1012c154b name:AppleHIDKeyboardEve product:Apple Internal Keyb eventType:3"
Timeout will fire in 300 secs Action=TimeoutActionRelease
pid 214(coreaudiod): [0x00164e440001880d] 00:05:54 PreventUserIdleSystemSleep named: "com.apple.audio.e8-07-bf-ae-c8-60:output.context.preventuseridlesleep"
Created for PID: 66605.
pid 38434(Skype Helper (Renderer)): [0x00058ea30001a012] 713:25:33 PreventUserIdleSystemSleep named: "NDI realtime UDP sending"
Kernel Assertions: 0x4=USB
id=1117 level=255 0x4=USB mod=01.01.70, 01:00 description=com.apple.usb.externaldevice.14300000 owner=Yubikey 4 OTP+U2F+CCID
Idle sleep preventers: IODisplayWrangler
There are n entries for Firefox included.
Reporter | ||
Comment 5•3 years ago
|
||
Also this does not only occur in fullscreen, but also in window mode. Triggering pause/play a couple of times didn't make a difference. But when I moved the video back into the normal browser window, the entries for Firefox appear again.
Assignee | ||
Comment 6•3 years ago
|
||
Could you describe what steps you did before you run pmset -g assertions
in comment4?
(In reply to Henrik Skupin (:whimboo) [⌚️UTC+2] (away 12/07 - 12/11) from comment #5)
Also this does not only occur in fullscreen, but also in window mode. Triggering pause/play a couple of times didn't make a difference. But when I moved the video back into the normal browser window, the entries for Firefox appear again.
So what you meant is that when you play media normally, which is not in either fullscreen or PIP window, Firefox didn't request any wakelock even if media is playing? (is that audible? is the video playing on the foreground)
Thank you.
Reporter | ||
Comment 7•3 years ago
|
||
Sorry when I was unclear, but with window mode I still meant PiP (not fullscreen). Playing videos within the browser window is all fine.
I haven't figured out steps yet. Maybe related to sleep mode, switching between battery and a/c. I will keep an eye on it.
Assignee | ||
Comment 8•3 years ago
|
||
So when that issue happens, if you set the video back to normal mode (not in PIP and fullscreen) and start it again, will Firefox request wakelocks?
I haven't figured out steps yet. Maybe related to sleep mode, switching between battery and a/c. I will keep an eye on it.
Sounds good, hope you can find steps, thank you!
Reporter | ||
Comment 9•3 years ago
|
||
(In reply to Alastor Wu [:alwu] from comment #8)
So when that issue happens, if you set the video back to normal mode (not in PIP and fullscreen) and start it again, will Firefox request wakelocks?
Yes, going back into PiP mode again, keeps the wakelocks enabled.
Reporter | ||
Comment 10•3 years ago
|
||
Ok, I think I figured out. Here the steps:
- Open two tabs with individual videos
- Start playing one video and move it into a PiP window
- Stop playing the video in the PiP window
- Switch to the other tab and play the video for a moment; then pause it
- Switch back to the PiP window and continue playing the video
After step 5 no wakelocks are enabled.
Assignee | ||
Comment 11•3 years ago
|
||
Thank you for the steps! I can reproduce it. Will take a look.
Assignee | ||
Comment 12•3 years ago
|
||
No one is using NewWakeLockOnBehalfOfProcess()
so we can remove it and its related methods.
Assignee | ||
Comment 13•3 years ago
|
||
In order to determine the hidden status of wakelock correctly, we should always consider the PIP state.
Depends on D99726
Assignee | ||
Comment 14•3 years ago
|
||
Depends on D99727
Assignee | ||
Updated•3 years ago
|
Comment 15•3 years ago
|
||
Pushed by alwu@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d94d067d265f part1 : remove unused methods. r=smaug https://hg.mozilla.org/integration/autoland/rev/7da73c89dd93 part2 : always use `IsDocumentInvisible()` to determine hidden state of wakelock. r=smaug https://hg.mozilla.org/integration/autoland/rev/ee6b7ecf08dc part3 : move PIP video test to a new test file and increase test cases. r=smaug
Comment 16•3 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/d94d067d265f
https://hg.mozilla.org/mozilla-central/rev/7da73c89dd93
https://hg.mozilla.org/mozilla-central/rev/ee6b7ecf08dc
Comment 17•3 years ago
|
||
The patch landed in nightly and beta is affected.
:alwu, is this bug important enough to require an uplift?
If not please set status_beta
to wontfix
.
For more information, please visit auto_nag documentation.
Assignee | ||
Comment 18•3 years ago
|
||
Comment on attachment 9193140 [details]
Bug 1679314 - part1 : remove unused methods.
Beta/Release Uplift Approval Request
- User impact if declined: user's screen would be off unexpectedly even if a user is playing video being used in picture-in-picture mode.
- Is this code covered by automated tests?: Yes
- Has the fix been verified in Nightly?: No
- Needs manual test from QE?: No
- If yes, steps to reproduce:
- List of other uplifts needed: None
- Risk to taking this patch: Low
- Why is the change risky/not risky? (and alternatives if risky): These patches didn't introduce new feature or behavioral change, they help to prevent computer from going sleeping by considering the picture-in-picture video's visibility. Also comes with automation test to prevent the issue happening again.
- String changes made/needed: no
Assignee | ||
Updated•3 years ago
|
Reporter | ||
Comment 19•3 years ago
|
||
Thanks, that works fine now with Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:86.0) Gecko/20100101 Firefox/86.0 ID:20201218095607.
Comment 20•3 years ago
|
||
Comment on attachment 9193140 [details]
Bug 1679314 - part1 : remove unused methods.
Approved for 85.0b4.
Updated•3 years ago
|
Updated•3 years ago
|
Comment 21•3 years ago
|
||
bugherder uplift |
https://hg.mozilla.org/releases/mozilla-beta/rev/b1ef34fea9d6
https://hg.mozilla.org/releases/mozilla-beta/rev/58a53219cb3f
https://hg.mozilla.org/releases/mozilla-beta/rev/6caa66b0a78c
Description
•