Closed fsalomon closed 3 years ago
Hey @fsalomon thank you for the report and code snippet. Our player has the internal capability to speed-up when the buffer grows large (we play at 1.03x in those situations, slowing down to 1x when the buffer shrinks below a threshold). We decided to not expose this API publicly at launch because it can have some downsides, e.g. audio pitching up and down on some browsers (Chrome and Firefox implement playback rate changes differently).
We're looking at exposing a different API that skips to the live edge after a buffer event in a subsequent player release, which sounds like it'd meet your requirements. Keep an eye on https://docs.aws.amazon.com/ivs/latest/userguide/release-notes.html for updates.
I have a use case where low latency is business critical. I literally prefer no video at all over delayed video.
I have received many reports from users (and observed myself) that in some cases, the delay (i.e. buffer duration) grows very high (> 30 seconds). These cases seem to be more frequent on mobile devices and/or when the video is played in the background. I have player.setLiveLowLatencyEnabled(true).
So I came up with a fix:
As you can see, the idea is to keep the buffer below 1.1 seconds by speeding up the playback rate. Yes, I'm aware, this can lead to frequent re-buffering on unstable connections, but I'm okay with that.
Now I'm asking: Why is such a feature not part of the library? Is there something I'm getting horribly wrong?