Issue
Can it be done? I've been tryind to find some workarounds for a couple of hours now, like triggering a click event on an undisplayed button after the page loaded or using ngAfterViewChecked, I need to do this because I'm trying to create a game and I want the main menu to have some background music, obviously I'll add the options to mute it and turn up/down the volume later, but I'd really like it to start with it instead of having something that says "ehy click me to turn on the music" coz that would be quite stupid and ugly on the page, what's odd is that like 80% of the times when I re-compile the music starts, but when I reload the page not
Solution
Most browsers today require user interaction unfortunately, no way around it. The button could just say "click to start"
https://developer.mozilla.org/en-US/docs/Web/Media/Autoplay_guide
Answered By - Luke Miles
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.