-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Howler.js 2.2.0 wont play on Safari (both MacOS and iOS 14 on mobile) #1407
Comments
I also just noticed an issue on Safari MacOS. Some of the sounds work and some don't. They all work in Chrome. Specifically the piano sound that happens after you hit the UP key to jump is missing only in Safari. Sadly, you have to wait for the monologue to finish before you can test that. |
Let's patiently wait til all the update fuzz is done on iOS 14. FYI: Something similar happened on iOS 13. |
i have same issue. i figure out what cause this issue in safari. (but not chrome in mac) in // If the sound hasn't loaded, we must wait to get the audio's duration.
// We also need to wait to make sure we don't run into race conditions with
// the order of function calls.
if (self._state !== 'loaded') {
// Set the sprite value on this sound.
sound._sprite = sprite;
// Mark this sound as not ended in case another sound is played before this one loads.
sound._ended = false;
// Add the sound to the queue to be played on load.
var soundId = sound._id;
self._queue.push({
event: 'play',
action: function() {
self.play(soundId);
}
}); in chrome, but i don't know why audio source is not loaded infinitely. 😭 |
I'm having the same issue. Chrome works, iOS 13 works, but iOS 14 doesn't. @Einere Is that a workaround to fix the issue? |
@marisancans // wrong
axios
...
.then((response) => response.data)
.then((data) => {
const blob = new Blob([data]);
const blobUrl = window.createObjectURL(blob);
const sound = new Howl({
src: [blobUrl],
html5: true,
...
})
})
... i fixed making blob url logic, then it works. // works
axios
...
.then((response) => response.data)
.then((data) => {
const blobUrl = window.createObjectURL(data); // pass blob directly
const sound = new Howl({
src: [blobUrl],
html5: true,
...
})
})
... if you using |
I’ll give it a try right now. Wish me luck |
@marisancans AWESOME!!!! That did the trick!!! You see... in my case was not a blob audio file by a WAV file that was recorded and uploaded to a remote server. I also had the idea that the issue could've been related to a cors issue. |
@inglesuniversal the fact that there is a workaround doesn't mean that the issue is resolved. Howlerjs should detect the platform and choose whether or not to use html5 audio as appropriate. I think the issue should be re-opened. |
Totally agree with your suggestion @ubershmekel issue has been re-opened |
I'm closing as I assume this is related to #1415, but if not I'll be happy to reopen. I'm not seeing any other issues in my testing on Safari 14 so far. |
Sorry to resurrect a closed issue, but just found out that apple has splitted it's iOS operating system into two after iOS 12 (last common OS among "mobile" devices). This issue (not yet sure about howler.js version) is still present on iPadOS, but not on iOS. |
I still have this issue on Howler v2.2.3. I have to detect iOS and change |
Same here with version 2.2.3. iOS 14 wont play audio unless Using webm and mp3 spritesheets |
Same here, Safari 14.1.2., IOS 15. Very strange, and I have been working on this bug for a couple weeks now. |
I just hit this too. I developed on desktop and android with v2.2.3 and my ios friends couldnt play my audio until i added: html5=true to my Howl() & sprite definition. The trouble now is that i have many sprites playing at once and that seems to overload html5's audio. ;-( |
Having this kind of issue. The html audio pool gets exhausted. However, I have made a singleton which only manages the constraint on the pool but there is no sound even with html5 enabled. |
html5=true work for me. Thank you so much! |
Sample LINK provided below:
AUDIO_SAMPLE
It was working fine until apple updated Safari on both Mac and iOS 14.0.1
No errors shown inside Safari console
Best regards
The text was updated successfully, but these errors were encountered: