howler.js icon indicating copy to clipboard operation
howler.js copied to clipboard

Some live streams (html5) buffer forever on Safari iOS 17.4

Open bikubi opened this issue 1 year ago • 17 comments

The Problem

Some radio streams buffer forever, never play.

This seems unrelated to

  • http or https
  • whether there are redirects to follow
  • format (aac or mp3)

Reproducible Example

No response

Reproduction Steps

  • clone the repo, serve it
  • edit examples/radio/radio.js, replace one station with http://chirpradio.org/stream (wonderful station from Chicago).
  • visit examples/radio on iOS 17.4 Safari
  • click play - it just idles
  • DevTools network tab shows that the request is consuming bytes at the the expected rate/bandwidth

Possible Solution

Naive analysis:

  • for some reason the initial Audio node (which is load()ed) doesn't receive canplaythrough, but suspend instead
  • the event queue is never kicked off
  • the node is stuck in a suspended limbo

Naive solution (fork incoming)

  • do not rely merely on canplaythrough
  • detect suspended ndoes

Better theoretical solution

Less complex Audio node setup?

Context

For some streams I tested, pre-following redirects helped. So maybe when the initial connection takes too long this trips up whatever changed in iOS 17.4.

Howler.js Version

v2.2.4

Affected Browser(s)/Versiuon(s)

Safari iOS 17.4

bikubi avatar Mar 11 '24 12:03 bikubi

We also experience this (or a similar) issue with Howler.js 2.2.4 and iOS 17.4. Would be great to get a fix as we are blocked right now ...

@goldfire I see a considerable amount of bugs in the issue list in this repo and little activity in the recent past. Also I see some recent PRs which are not accepted/merged or commented. Can we expect this library to be reasonably maintained in the future?

tobias-graf-p avatar Mar 12 '24 09:03 tobias-graf-p

@tobias-graf-p just in case & and all, see my commit linked above for a ~~possible fix~~ workaround. It works for us, but I don't know if there are any side effects or unwanted consequences.

bikubi avatar Mar 12 '24 09:03 bikubi

@bikubi Thanks a lot! We are currently testing your fix. Will give you a quick feedback whether it solved our issue as well and/or whether we experience side effects.

tobias-graf-p avatar Mar 12 '24 09:03 tobias-graf-p

Same problem.

@bikubi Your solution helped, thanks!

rgyph avatar Mar 13 '24 07:03 rgyph

@tobias-graf-p

I see a considerable amount of bugs in the issue list in this repo and little activity in the recent past. Also I see some recent PRs which are not accepted/merged or commented. Can we expect this library to be reasonably maintained in the future?

FWIW one of my (trivial) fixes was merged recently.

For general analysis regarding Howler vs. live streams you might want to read my question on s/o.

bikubi avatar Mar 13 '24 14:03 bikubi

@bikubi Thanks again a lot for your workaround/fix. Unfortunately it didn't solve our issue completely. While audio was being played again, some wired issues still remained, but we are not sure whether they originated from iOS, Howler.js or our own code ... Meanwhile we replaced Howler.js with the native Html5 audio tag in our project.

tobias-graf-p avatar Mar 25 '24 19:03 tobias-graf-p

Can confirm. iOS 17.3 was working fine. Upgrade it to 17.4, not working now.

MichalisDBA avatar Mar 26 '24 17:03 MichalisDBA

Reporting the same issue in 17.4 and 17.4.1, I changed to native HTML5 audio in 4 sites.

deltayeisson avatar Mar 27 '24 17:03 deltayeisson

same problem,Is there a way to solve this?

danieldai2003 avatar Mar 30 '24 08:03 danieldai2003

Any update about this bug? 😵‍💫

betanyeli avatar Apr 08 '24 09:04 betanyeli

Hi! I generated a patch based on the commit 8bb0610 that applies the change directly on the dist/howler.js so I could use it in a Drupal project. If someone else needs it, here's the file:

1711-8bb0610.patch

After that change was applied, the player started to work again, so thanks @bikubi !! Still need further testing, but it will help us for now!

luzzardi avatar Apr 15 '24 15:04 luzzardi

@bretth18 thanks for your repo:

yarn remove howler && yarn add https://github.com/catalogworks/howler.js worked like a charm

I only had to change the import: import {Howl, Howler} from '@catalogworks/howler';

Problem solved!

lustremedia avatar Apr 24 '24 12:04 lustremedia

@lustremedia and all, please note that i would not consider my workaround a fix!! @bretth18's repo adds some comments, a .gitignore and a version bump, which might give you trouble in the future.
It's nice that you can simply change your package.json, but for the "problem" to be "solved" somebody with more familiarity with Howler will need to properly fix the core issue!

bikubi avatar Apr 24 '24 12:04 bikubi

Of course it is just a workaround, but it fixes the issue at hand, atm.

You can easily roll back once howler starts properly fixing the issue. In the meantime, I and also my listeners with iOS devices are greatly appreciating the work you put in -> @bikubi and @bretth18! Thank you!

lustremedia avatar Apr 24 '24 12:04 lustremedia

@bretth18 thanks for your repo:

yarn remove howler && yarn add https://github.com/catalogworks/howler.js worked like a charm

I only had to change the import: import {Howl, Howler} from '@catalogworks/howler';

Problem solved!

I did this and it works. Thanks a lot for sharing!

torbentschechne avatar Apr 25 '24 12:04 torbentschechne

is this library going to be maintained? ios new update is always so much headache

AashirBhusal avatar Apr 28 '24 10:04 AashirBhusal

Hey all,

I just tested it with 17.5.1 and in my case both versions work. So when I have this in my package.json

"@catalogworks/howler": "github:catalogworks/howler.js",

the playback works. And also when I use

"howler": "~2.2.4",

it works with 17.5.1. Can somebody else confirm this? So it seems Apple fixed something in 17.5.

torbentschechne avatar May 21 '24 07:05 torbentschechne