A web-platform-tests infrastructure test I added in https://github.com/web-platform-tests/wpt/pull/13622 is failing in Safari because the audio element's paused attribute is still true immediately after calling `a.play()`. There are a lot of tests in web-platform-tests written before autoplay restrictions were widespread, so to make these work a setting to disable these restrictions is needed. Something like the com.apple.Safari WebKitJavaScriptCanOpenWindowsAutomatically setting. Testing with Safari TP 67.
Philip, there is UI for enabling autoplay in Safari and STP. Preferences -> Websites -> Auto-Play -> "When visiting other websites": "Allow all auto-play". This can either be done globally for all websites, or you can add settings for each of the WPT domains.
One possibility would be to expose this through Web Driver or scripting so that WPT infra could opt in that mode more easily. Another approach is to rewrite tests in a way that autoplay is respected. For instance, a routine to call play() as part of a Web Driver click event callback. Not sure how much tests are impacted.
Jer, do you know if that setting is backed by something that can be written using defaults write com.apple.Safari ... ? I tried changing the setting back and forth but can't observe any change in the output of `defaults read com.apple.Safari` or `defaults read com.apple.SafariTechnologyPreview`. There are a bunch of Safari-only failures on wpt.fyi because of this and it would be nice to get those failures out of the way to see if there's something more interesting: https://wpt.fyi/results/html/semantics/embedded-content/media-elements?run_id=5141852206399488&run_id=6579630693679104&run_id=5904569678692352
<rdar://problem/75495649>