Re: [wake-lock] Need maximum screen brightness mode (#129)

Hey all, I wanted to resurrect this discussion as there doesn’t seem to have been any resolution. We’ve heard this feature request a few times now from customers so it seems like it’s needed.

Reading through the above, there seem to be two options:

1. Implement a screen brightness configuration option as part of Wake Lock, or
2. Implement a separate brightness control API.

Is that a fair assessment? Then, beyond that, there is some discussion around how much control a developer should be granted over screen brightness:

1. Full, granular control
2. Ability to request full brightness, lowest brightness, or return to system settings

Based on my read through of the concerns above, it seems like the "lowest" brightness setting (if we decided to implement it) should not allow for a completely blank screen, right? I’m honestly uncertain what a use case for such an option would be, so it may not be needed.

Personally, I like @marcoscaceres’ [API recommendation](#issuecomment-441124143):

```js
navigator.getWakeLock("screen", {fullBrightness: true}).then(wakeLock => {
  var request = wakeLock.createRequest();
  setTimeout(() => {
    request.cancel();
  }, 1000);
});
```

If we decided that we did want to have the lowest brightness option, that configuration option could probably be `brightness` with the acceptable values being "highest," "lowest", "none" (with "none being the default"?).

In terms of a use case roundup, here’s what I’ve got:

* **Any app that generates QR codes or hosts barcodes that need to be scanned.** Examples include: 
  * Rewards programs (e.g., Starbucks, Whole Foods),
  * Single use barcodes for coupons and such (e.g., LivingSocial, Groupon),
  * Payment systems (e.g. Target, some bank transfer programs),
  * 2FA (e.g., WhatsApp)
* **Apps that make use of the front camera for photos or video conferencing.** I’ve seen a few apps that use the screen brightness as a pseudo flash.
 

-- 
GitHub Notification of comment by aarongustafson
Please view or discuss this issue at https://github.com/w3c/wake-lock/issues/129#issuecomment-503254399 using your GitHub account

Received on Tuesday, 18 June 2019 18:23:36 UTC