Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Requesting a wake lock when going fullscreen #185

Open
marcoscaceres opened this issue Sep 18, 2020 · 6 comments
Open

Requesting a wake lock when going fullscreen #185

marcoscaceres opened this issue Sep 18, 2020 · 6 comments

Comments

@marcoscaceres
Copy link
Member

marcoscaceres commented Sep 18, 2020

It might be nice to be able to request a screen wake lock when requesting fullscreen. Use case, for example, giving a live presentation via a website (see other possible use case).

I'm imagining something like:

body.requestFullscreen({ keepScreenOn: true });

Unlike the Screen Wake Lock API, this would have several advantages:

  • remove the need for developer to have to manage multiple locks.
  • explicitly ties into the implicit grant permissions model of the Fullscreen API, while keeping the use in control: When the user exits full screen, the screen wake lock is silently released.
  • no information leakage: the website would not know if the request for the wake lock was granted, and the OS or browser could safely drop the request without notifying the website that it no longer has the lock (e.g., the device enters a low-power state).

The behavior would be exactly the same as watching a video full screen, which also acquires a wake lock.

@saschanaz
Copy link
Member

Layperson question: do users expect wake lock when the content is not in fullscreen? Skimming the wake lock use cases, I'd expect fullscreen for all of them 👀

@annevk
Copy link
Member

annevk commented Sep 28, 2020

I do... When watching an inline movie on Twitter or some such I do not expect the screen to turn off and yet it does at times. (It's not clear how you'd ask the user that though. Probably the system should just be more aware that the user is watching something.)

@saschanaz
Copy link
Member

When watching an inline movie on Twitter or some such I do not expect the screen to turn off and yet it does at times.

It seems this covers such case in Gecko: https://bugzilla.mozilla.org/show_bug.cgi?id=1665980

@marcoscaceres
Copy link
Member Author

To @annevk's use case, I think the behavior may be UA specific... like NoSleep.js uses a hidden video to keep the screen awake. Similarly (or more generally), fullscreen video always automatically gets a wake lock.

@saschanaz
Copy link
Member

Another question from me: when does a user expect fullscreen-without-wakelock? Can wakelocking be the default behavior?

@marcoscaceres
Copy link
Member Author

yeah, I agree. That's a better question. A few things I can think of... the "distraction free writing" mode like in WordPress... I might get up to make a coffee in the middle of writing, so I'd probably don't want it to hold a wake lock.

Similarly, I think VS Code has a similar "zen" mode. Again, I might be in Zen mode, but might get up to do something (e.g., rest room, answer the door or phone) - so I probably don't want it to hold a wake lock there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants