0

My question is similar to this one: How to make audio autoplay on chrome

...although most of the answers on that fail today or rely on tricks that will inevitably be fixed in the future. However, in my scenario, I have an additional advantage - I only need this to work on one specific machine on a specific page (just an auto-refreshing dashboard page), so I'm open to command line parameters or even other browsers that might allow me to override autoplay policies.

There's also this answer: Chrome Autoplay Policy - Chrome 76

...and someone suggested this:

google-chrome-stable --kiosk http://google.com/ --new-window --start-maximized --incognito  --autoplay-policy=no-user-gesture-required --disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies &

...however that doesn't seem to work anymore (I adjusted the initial command from "google-chrome-stable" to the "chrome.exe" executable on my test machine). The desired page loads up just fine but it doesn't autoplay the audio until I interact with it (e.g. manually refresh the page) to provide that user gesture. Once I provide a user gesture, audio autoplays fine.

I'm even open to building a simple custom C# browser app with CefSharp (I have a couple of those already), but none of the suggested solutions work with that, either. It seems like everything I find is referencing an older version.

Any suggestions for this situation in 2021 which isn't something that could be seen as an exploitable workaround (e.g. Javascript triggering a click) that would probably be fixed in a near future build of browsers?

jhilgeman
  • 1,543
  • 10
  • 27
  • Quick search through the chromium source and it looks like they are still using auto play policy for internal testing, so I'd expect it still works. Try the command line args listed at https://source.chromium.org/chromium/chromium/src/+/master:content/test/gpu/measure_power_intel.py;l=171?q=no-user-gesture-required&ss=chromium – amaitland Feb 05 '21 at 22:29
  • I'd also suggest adding relevant tags for chrome/edge. – amaitland Feb 05 '21 at 22:30

1 Answers1

-1

The command line does not work because the statement that should allow the sound to play

--autoplay-policy=no-user-gesture-required

is cancelled by the

--disable-features=PreloadMediaEngagementData,AutoplayIgnoreWebAudio,MediaEngagementBypassAutoplayPolicies

which is equivalent to "autoplay is never allowed".

Full details can be found in the 'Developer Switches' from the Chrome documentation (https://developer.chrome.com/blog/autoplay/).