Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix WebAudio playback due to autoplay policy changes #37

Merged
merged 1 commit into from
Feb 19, 2018

Conversation

beaufortfrancois
Copy link
Contributor

@beaufortfrancois beaufortfrancois commented Feb 5, 2018

Due to upcoming Autoplay policy changes, an AudioContext must be created or resumed after the document received a user gesture to enable audio playback.

More at https://webaudio.github.io/web-audio-api/#dfn-allowed-to-start

/me excited to contribute to this essential PWA ;)

@PaulKinlan PaulKinlan merged commit 26f4ba5 into master Feb 19, 2018
@PaulKinlan
Copy link
Member

thank you

@beaufortfrancois beaufortfrancois deleted the beaufortfrancois-patch-1 branch February 19, 2018 14:50
@AdrianJagodznski
Copy link

AdrianJagodznski commented Sep 20, 2018

Can you fix this?

The Web Audio autoplay policy will be re-enabled in Chrome 70 (October 2018). Please check that your website is compatible with it. https://goo.gl/7K7WLu
_ @ howler.core.min.js?v=7ed9cd42da:2
init @ howler.core.min.js?v=7ed9cd42da:2
o @ howler.core.min.js?v=7ed9cd42da:2
(anonymous) @ root_framework.js.eff0f9a9c6760d3af9e5655dad9a9906.js?v=7ed9cd42da:838
createModule @ root_library.js.df4bbad334f2141f77417cb64963a856.js?v=7ed9cd42da:34
(anonymous) @ root_framework.js.eff0f9a9c6760d3af9e5655dad9a9906.js?v=7ed9cd42da:838
(anonymous) @ root_framework.js.eff0f9a9c6760d3af9e5655dad9a9906.js?v=7ed9cd42da:842

howler.core.min.zip

@KyleSanderson
Copy link

@beaufortfrancois you've destroyed background audio playing in atleast all https://github.com/ValveSoftware games. Can you please revert this or come up with a suitable way to play music in the background for people using CEF?

@KyleSanderson
Copy link

https://ice.plaguefest.com/radio.html for an example (check out JS).

	RegAdminCmd("sm_djrst", OnResetStreamAll, ADMFLAG_ROOT, "DJ made a mistake, save themselves.");
	RegAdminCmd("sm_djs", OnStreamStats, ADMFLAG_ROOT, "Stream Stats.");
	RegConsoleCmd("sm_djr", OnResetStream, "Reset the stream.");
	RegConsoleCmd("sm_djf", OnForgetDJ, "Toggles Eligibility of Radio.");
	RegConsoleCmd("sm_djv", OnDJVolume, "Increases or Decreases the volume of the Radio.");
	RegConsoleCmd("sm_djt", OnDJTrack, "Prints the Present Track.");

@textfiles
Copy link

textfiles commented Oct 23, 2018

Anybody who is coming late into this would do well to see the original announcement and the tidal wave of reaction to this poor approach, followed by what is apparently 8 months of waiting for the furor to die down and then re-introduce it:

https://developers.google.com/web/updates/2017/09/autoplay-policy-changes

@woodydeck
Copy link

woodydeck commented Mar 2, 2019

I wasn't aware of this issue until developing a game in Phaser. Then I read about media engagement indexes from the link in the console log. This was the straw that broke the camel's back. Chrome is uninstalled for me, and I will not support the browser as an independent developer.

This issue is analogous to social credit scoring in China, which I'm certain someone google related had a hand in implementing. Sad.

@KyleSanderson
Copy link

@woodydeck yeah; I actually lost a friend over this ( @psychonic ). I'm using a couple 0days now as @Nephyrin and @kisak-valve really don't give a shit as TF and similar are end of life. Honestly the entire thing is tragic but all you can do is hope for the future (and that clients don't crash when you're running shell code; Linux is ironically a nightmare).

@Tectract
Copy link

No idea what I'm looking at. I got here because of this bug:

The AudioContext was not allowed to start. It must be resumed (or created) after a user gesture on the page. https://goo.gl/7K7WLu

How do I re-enable audio, or bypass/fix this bug? My application plays audio to ALERT people to look at the page, not in response to any user action.

@optionj85
Copy link

optionj85 commented Dec 22, 2019

I have a web application that is browsed-to by plugins for OBS and XSplit live-streaming software. My application allows the user to assign sounds to play at a specific time after the page is loaded. This is by design and configurable by my customers - in addition, the customer is the only person that will be viewing the page directly. The web application is by no means similar to the browsing experience that this policy has been put in place to protect. What should people in my situation do about this?

@Tectract
Copy link

Tectract commented Dec 22, 2019

Good luck, it's totally broken. In their attempt to block "autoplay" video, browser devs completely messed up sound for millions of sites. All mainstream media sites still autoplay video using shady hacks now. Isn't this better?

@CarlBinneman
Copy link

So... Dicks to everyone working in web development?

@xgqfrms
Copy link

xgqfrms commented Nov 24, 2022

📝 still no way to autoplay audio with sound, even if it is muted.

outdated solutions

https://stackoverflow.com/questions/50490304/how-to-make-audio-autoplay-on-chrome

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

10 participants