Closed increpare closed 4 years ago
I think it’s due to Safari not being able to play OGG files.
I think Mode includes both mp3 and ogg assets on HTML5.
This is the same issue I encountered back in May, but for me, the game just freezes entirely -- it doesn't even play silently. Just checked on Safari 12.0.2 and it still has that behavior. Strange...
EDIT: Project Jumper used to play audio, but it doesn't anymore. I'll investigate further. Maybe something did change in Safari.
Hi. I was trawling the issues page for something unrelated, but: I had a similar experience with one of my html5 games not using flixel. New versions of Safari will block audio playback until an html game’s canvas has been interacted with (a click or touch).
One solution is to add a window listener on the JavaScript side to start / resume audio playback on the first interaction and then remove itself from event listeners.
Hope this helps.
Haxe version: ?.?.? whatever version is used on the website build https://haxeflixel.com/demos/Mode/
Flixel version: ?.?.? whatever version is used on the website build
OpenFL version: ?.?.? whatever version is used on the website build
Lime version: ?.?.? whatever version is used on the website build
Affected targets: html5
Code snippet reproducing the issue:
whatever version is used on the website build
Observed behavior: In safari 12.0.1, I hear nothing. In chrome 70.0.3538.110 I hear sound fine. I'm on macOS 10.14.1
Expected behavior: I would like to hear sounds on both.
(this is probably due to how safari handles audiocontexts now ( https://hackernoon.com/unlocking-web-audio-the-smarter-way-8858218c0e09 ), and how chrome will very, very soon ( https://groups.google.com/a/chromium.org/forum/#!msg/blink-dev/5Y1BqbGauEs/rRocaytKBgAJ ) )