Open andy-fillebrown opened 1 day ago
Could you provide a full repro case and example of proposed API?
It may not be possible without changing the browser build settings. See bootstrap.diff:23122 for the webkit build for example.
I assume there's something similar for the chromium build. It might be better to leave the autoplay build settings alone so autoplay is disabled by default, and then add CLI flags for each browser to enable it. So for chromium the flag to set would be --autoplay-policy=no-user-gesture-required
. I'm not sure if there are Firefox and Webkit equivalents.
If it were done that way then ignoreDefaultArgs
could be used to disable autoplay: https://playwright.dev/docs/api/class-browsertype#browser-type-launch-option-ignore-default-args.
🚀 Feature Request
When creating a new
AudioContext
, its initialstate
is"running"
, which is good for testing audio, but does not reflect the initial state encountered by users of a website, which is"suspended"
and requires a user interaction for theAudioContext.resume()
promise to resolve.If possible, please add an option that makes
AudioContext
's initial state"suspended"
, and require a user interaction for theAudioContext.resume()
promise to resolve.Example
No response
Motivation
This would make it possible to test the user interaction requirements for autoplay implemented by browsers. See https://developer.chrome.com/blog/autoplay for more info on Chrome's requirements. Webkit's requirements are similar.