Bug 190775 - Need Safari setting to allow autoplaying audio for web-platform-tests
Summary: Need Safari setting to allow autoplaying audio for web-platform-tests
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2018-10-20 10:56 PDT by Philip Jägenstedt
Modified: 2024-10-03 09:10 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Philip Jägenstedt 2018-10-20 10:56:35 PDT
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.
Comment 1 Jer Noble 2018-10-22 00:19:36 PDT
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.
Comment 2 youenn fablet 2018-10-22 00:29:30 PDT
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.
Comment 3 Philip Jägenstedt 2019-04-02 13:56:41 PDT
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
Comment 4 Radar WebKit Bug Importer 2021-03-16 14:51:04 PDT
<rdar://problem/75495649>