goldfire / howler.js

Javascript audio library for the modern web.
https://howlerjs.com
MIT License
24.09k stars 2.24k forks source link

seek does not work on ios 13.5 for live audio streaming #1379

Open anleodev opened 4 years ago

anleodev commented 4 years ago

When I run a stream on ios and want to rewind back it does not rewind anything though the method works

this.activeStation.player = new Howl({ src: 'http://online.kissfm.ua/KissFM', html5: true, preload: 'metadata', }); await this.activeStation.player.pause(); await this.activeStation.player.seek(30); await this.activeStation.player.play();

jchristin commented 4 years ago

I got a similar issue. Does it work if you set html5 property to false?

bikubi commented 4 years ago

Assuming that you are not trying to seek into the future (your code example could be read that way), instead doing something like: play → pause for 30s → seek forward 30s
...i still see almost no chance to do this reliably.

What I have found dealing with similar problems is that HTML5 audio seemingly wasn't built with a focus on live streams, plus every browser adds idiosyncrasies on top. E.g. there is no way to specify buffers - usually these are more important as pre-buffers. What you are looking for is a kind of post-buffer, which assumes that the browser keeps any amount of media stored & accessible. (On a related note: there is no way to specify how long you can reliably pause a live stream...) Even if rewinding a stream works in other browsers/OSs I would not count on it. For live streams I would consider this behavior undefined.

(Oh and, conceptually: live streams, especially radio, usually weren't meant to be paused. AFAIK this is more in the domain of TiVo/DVR/PVR...)

@jchristin -- live streams only work with html5=true IIRC.