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

Fixed an edge case with Safari ("infinite" html5 audio -> the end event won't run) #658

Merged
merged 4 commits into from
Oct 25, 2020

Conversation

golddranks
Copy link
Contributor

Fixes #657 . I'm not well-versed with the codebase, so I tried to code only for the bugged case (checks to call _ended() only if the audio duration was indeed said to be infinite), but it might be, of course, that there is more related, unaccounted edge cases.

@golddranks
Copy link
Contributor Author

golddranks commented Nov 26, 2016

In particular, I'm not sure about removing the event listener after the event is run. I did it because the other event listeners did so too. Are the _nodes re-used (replayed)? After the end is reached, Safari updates the _node.duration to reflect the real duration, but of course this isn't reflected in _parent._duration, so that might cause problems. A review needed!

Btw. to reproducing Safari setting the duration to infinite isn't too easy: it happens to me only if I shut down the server, let the loading fail, and then boot it up, and try loading the same sound again. Safari then sends a Range: bytes=0-1 HTTP header, if to which the server doesn't respond correctly (or doesn't support Range requests), Safari sets the audio duration to infinite.

@golddranks
Copy link
Contributor Author

Okay, I did one change: it now checks if the duration was set to infinite, and updates the parent _duration field and the default sprite, so the subsequent calls to play() will end as normally.

@golddranks
Copy link
Contributor Author

Rebased the commits on master. @goldfire, do you think you could pull these in? They fix an edge case on Safari.

@BuddhaBing
Copy link

This is still an issue on Safari. Could this fix be merged in please?

@golddranks
Copy link
Contributor Author

I'd love to see this as merged too. I wonder if this project is abandoned / not maintained?

@goldfire
Copy link
Owner

@golddranks The project is definitely maintained and not abandoned. We've just gone through some major crunch with a big game launch on Steam last week and I've barely had time to think about anything else. I'll be catching up on howler issues/pr's in the coming weeks.

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.

Quirk in Safari: duration: infinite
3 participants