Closed Bug 952835 Opened 6 years ago Closed 6 years ago

screen goes to sleep while video still playing in Metro Firefox

Categories

(Firefox for Metro Graveyard :: General, defect, P2)

29 Branch
x86_64
Windows 8.1
defect

Tracking

(firefox28 verified, firefox29 verified)

VERIFIED FIXED
Firefox 29
Tracking Status
firefox28 --- verified
firefox29 --- verified

People

(Reporter: krudnitski, Assigned: rsilveira)

References

Details

(Whiteboard: [beta28] [defect] p=5)

Attachments

(1 file, 2 obsolete files)

on my surface pro 2, nightly (12-20 build still).

Go to this website: http://www.doyogawithme.com/content/mamachi-flow-prenatal-yoga-class-morning-flow and the screen goes to sleep even with the video still playing. Video pauses, and resumes once the screen is woken up again.

Expected behaviour: if I'm watching a video, screen stays on.
Whiteboard: [triage] → [beta28] [defect] p=0
Documentation for Windows Store apps:
http://msdn.microsoft.com/en-us/library/windows/apps/jj152725.aspx

Do we have logic to prevent screensaver/sleep during video playback on other platforms?
Blocks: 517870
> Do we have logic to prevent screensaver/sleep during video playback on other
> platforms?

We have code to do this on Android (bug 739542), and open bugs for other platforms (bug 517870, bug 772347).
Summary: screen goes to sleep while video still playing → screen goes to sleep while video still playing in Metro Firefox
Assignee: nobody → rsilveira
Attached patch Feedback v1 (obsolete) — Splinter Review
Code is working fine. I'm not sure it's in the right place though. Also, the power manager service throws when closing the browser, due to ref count. It's destroyed before MetroAppShell gets destroyed and we remove the wakelock listener. Don't know where it should be. 

Code is hooking up a WakeListener to power management service like Android is doing at [1] and [2].
Callback states for nsIDOMWakeLockListener are documented at [3]. Android's locking logic is at [4].

[1] - http://mxr.mozilla.org/mozilla-central/source/widget/android/nsAppShell.cpp#113
[2] - http://mxr.mozilla.org/mozilla-central/source/widget/android/nsAppShell.cpp#188
[3] - http://mxr.mozilla.org/mozilla-central/source/dom/power/nsIDOMWakeLockListener.idl#9
[4] - http://mxr.mozilla.org/mozilla-central/source/mobile/android/base/GeckoApp.java#2617
Attachment #8360618 - Flags: feedback?(jmathies)
Attached patch Patch v1 (obsolete) — Splinter Review
Fixed the ref count issue after IRC chat with Jimm.
Attachment #8360618 - Attachment is obsolete: true
Attachment #8360618 - Flags: feedback?(jmathies)
Attachment #8360713 - Flags: review?(jmathies)
Comment on attachment 8360713 [details] [diff] [review]
Patch v1

Review of attachment 8360713 [details] [diff] [review]:
-----------------------------------------------------------------

::: widget/windows/winrt/MetroAppShell.cpp
@@ +54,5 @@
> +public:
> +  NS_DECL_ISUPPORTS;
> +
> +private:
> +  ComPtr<ABI::Windows::System::Display::IDisplayRequest> displayRequest;

nit - mDisplayRequest

@@ +56,5 @@
> +
> +private:
> +  ComPtr<ABI::Windows::System::Display::IDisplayRequest> displayRequest;
> +  
> +  NS_IMETHOD Callback(const nsAString& aTopic, const nsAString& aState) {

nit - white space above here
Attachment #8360713 - Flags: review?(jmathies) → review+
Attached patch Patch v2Splinter Review
Patch with nits addressed.
Attachment #8360713 - Attachment is obsolete: true
Blocks: metrov1it22
No longer blocks: metrov1backlog
Status: NEW → ASSIGNED
Priority: -- → P2
QA Contact: jbecerra
Whiteboard: [beta28] [defect] p=0 → [beta28] [defect] p=5
https://hg.mozilla.org/mozilla-central/rev/f67a5c0ff459
Status: ASSIGNED → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
Whiteboard: [beta28] [defect] p=5 → [beta28] [defect] p=5 [approval-mozilla-aurora=metro-only]
https://hg.mozilla.org/releases/mozilla-aurora/rev/e5e71feaf49c
Keywords: checkin-needed
Whiteboard: [beta28] [defect] p=5 [approval-mozilla-aurora=metro-only] → [beta28] [defect] p=5
For iteration #22, verified as fixed with latest Nightly and Aurora on Win 8.1 64-bit.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.