screen goes to sleep while video still playing in Metro Firefox

VERIFIED FIXED in Firefox 28

Status

Firefox for Metro
General
P2
normal
VERIFIED FIXED
4 years ago
4 years ago

People

(Reporter: kar, Assigned: rsilveira)

Tracking

29 Branch
Firefox 29
x86_64
Windows 8.1
Dependency tree / graph

Firefox Tracking Flags

(firefox28 verified, firefox29 verified)

Details

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

Attachments

(1 attachment, 2 obsolete attachments)

(Reporter)

Description

4 years ago
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.

Updated

4 years ago
Blocks: 838081

Updated

4 years ago
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)

Updated

4 years ago
Assignee: nobody → rsilveira
Created attachment 8360618 [details] [diff] [review]
Feedback v1

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)
Created attachment 8360713 [details] [diff] [review]
Patch v1

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 5

4 years ago
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+
Created attachment 8360722 [details] [diff] [review]
Patch v2

Patch with nits addressed.
Attachment #8360713 - Attachment is obsolete: true

Updated

4 years ago
Blocks: 955892
No longer blocks: 838081
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
Last Resolved: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 29
(Assignee)

Updated

4 years ago
Whiteboard: [beta28] [defect] p=5 → [beta28] [defect] p=5 [approval-mozilla-aurora=metro-only]
(Assignee)

Updated

4 years ago
Keywords: checkin-needed
https://hg.mozilla.org/releases/mozilla-aurora/rev/e5e71feaf49c
status-firefox28: --- → fixed
status-firefox29: --- → fixed
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
status-firefox28: fixed → verified
status-firefox29: fixed → verified
You need to log in before you can comment on or make changes to this bug.