Skip to content

Require transient activation#351

Open
marcoscaceres wants to merge 3 commits intogh-pagesfrom
transient
Open

Require transient activation#351
marcoscaceres wants to merge 3 commits intogh-pagesfrom
transient

Conversation

@marcoscaceres
Copy link
Member

@marcoscaceres marcoscaceres commented Sep 28, 2022

@marcoscaceres marcoscaceres mentioned this pull request Sep 28, 2022
4 tasks
@marcoscaceres
Copy link
Member Author

Updated tests ... web-platform-tests/wpt#36122

@reillyeon
Copy link
Member

To make this change in Chromium we should do analysis of the compatibility impact and announce a deprecation.

It looks like requiring transient activation is not a normative requirement for the <video> tag. I am not familiar with which browsers enforce this requirement. One data point is that NoSleep.js recommends wrapping the call to their library in an input handler. I assume that is because it falls back to using a <video> element and some browsers require user activation to play a video (or to take a wake lock while playing video).

@marcoscaceres
Copy link
Member Author

It looks like requiring transient activation is not a normative requirement for the

Sorry, I wasn't very clear. The transient activation aspect I was referring to was the act of pressing the play button.

One data point is that NoSleep.js recommends wrapping the call to their library in an input handler. I assume that is because it falls back to using a

Yes, exactly that. That's to allow the video to play with audio, even though it's silent (Safari detects it a video that's making noise).

Screen Shot 2022-09-29 at 9 42 55 am

@marcoscaceres
Copy link
Member Author

Ok, we've updated WebKit to not consume user activation.

@marcoscaceres
Copy link
Member Author

Send a PR with an isolated test web-platform-tests/wpt#36152

@reillyeon, wrote:

To make this change in Chromium we should do analysis of the compatibility impact and announce a deprecation.

Ok, no problem. WebKit will probably ship requiring transient activation. I think we are willing to take the compat hit as otherwise we feel the API might be too easy to abuse.

@marcoscaceres
Copy link
Member Author

Closing based on @anssiko comment #326 (comment)

Can someone please take this up though? 🙏

aarongable pushed a commit to chromium/chromium that referenced this pull request Oct 1, 2022
This will be used to understand the compatibility impact of adding a
transient activation requirement as proposed in
w3c/screen-wake-lock#351.

Bug: 1370132
Change-Id: Iff35979eef46d640aaf8b8f6a336546c03ff0355
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3928945
Auto-Submit: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Raphael Kubo Da Costa <raphael.kubo.da.costa@intel.com>
Commit-Queue: Reilly Grant <reillyg@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1053843}
@marcoscaceres marcoscaceres reopened this Apr 8, 2024
@reillyeon
Copy link
Member

Is WebKit open to switching to a sticky activation model? Chromium's metrics look better for that and it means that a site can reacquire a lock if it had one before but lost it due to visibility changes.

@marcoscaceres marcoscaceres added the TPAC2025 Topics for discussion at TPAC 2025 label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

TPAC2025 Topics for discussion at TPAC 2025

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require transient activation to request lock

2 participants