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

[v3] Await some delay before re-attempting to push a segment following an error #1411

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

peaBerberian
Copy link
Collaborator

@peaBerberian peaBerberian commented Mar 19, 2024

This PR updates the way the RxPlayer handles a QuotaExceededError error thrown by a SourceBuffer.prototype.appendBuffer call, to align it better to how we do it in the v4 - which seems more appropriate.

The idea is that a browser might throw this QuotaExceededError when too much data has been pushed to the buffer and thus the browser is not able to accept any more segments for now.

In the v3 until now, what the RxPlayer did was trying to remove some data from the buffer - even skipping that part if the buffer was already empty enough - and then re-attempting to push the same segment. If the error repeats, there is a complex chain of events that lead to the buffering of that segment (at least in our last v3 releases), so there's no real issue there. in the end

The idea of this PR is to prevent doing the re-attempt of pushing the same segment directly, mostly for cases where the data-removal step is skipped, by awaiting 200 milliseconds.
This is just to improve our chances that the second push attempts works, as we've seen it fail in rare conditions on some devices.

I also added some code ensuring that we do not retry to push the segment if the corresponding "RepresentationStream" has been cancelled while it was awaiting those 200 milliseconds.

…g an error

This commit updates the way the RxPlayer handles a `QuotaExceededError`
error thrown by a `SourceBuffer.prototype.appendBuffer` call, to align
it better to how we do it in the v4 - which seems more appropriate.

The idea is that a browser might throw this QuotaExceededError when too
much data has been pushed to the buffer and thus the browser is not able
to accept any more segments for now.

In the v3 until now, what the RxPlayer did was trying to remove some
data from the buffer - even skipping that part if the buffer was
already empty enough - and then re-attempting to push the same segment.
If the error repeats, there is a complex chain of events that lead to
the buffering of that segment in our last v3 releases, so there's
no real issue there.

The idea of this commit is to prevent doing the re-attempt of pushing
the same segment directly, mostly for cases where the data-removal step
is skipped, by awaiting 200 milliseconds.
I also added some code ensuring that we do not retry to push the
segment if the corresponding "RepresentationStream" has been cancelled
while it was awaiting those 200 milliseconds.
@peaBerberian peaBerberian added this to the 3.33.3 milestone Mar 26, 2024
@peaBerberian peaBerberian merged commit 21aa959 into legacy-v3 Mar 26, 2024
3 checks passed
@peaBerberian peaBerberian mentioned this pull request Jun 12, 2024
@peaBerberian peaBerberian deleted the misc/await-before-push-reattempt branch July 26, 2024 16:38
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.

2 participants