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

Detecting player stall after max attempts reached #7794

Open
lericson-ideanova opened this issue Dec 20, 2024 · 7 comments
Open

Detecting player stall after max attempts reached #7794

lericson-ideanova opened this issue Dec 20, 2024 · 7 comments
Assignees
Labels
type: question A question from the community

Comments

@lericson-ideanova
Copy link

Have you read the Tutorials?
Yes

Have you read the FAQ and checked for duplicate open issues?
Yes

If the question is related to FairPlay, have you read the tutorial?

N/A

What version of Shaka Player are you using?
4.4.0

What browser and OS are you using?
Chrome, Mac OS Sequoia 15.1.1

Please ask your question
Hello, I am trying to detect when the player has stalled and will not recover in order to display an error message. Based on the current network errors, I do not see how shaka notifies that this situation has been reached.

I tried detecting network errors, It looks like ATTEMPTS_EXHAUSTED would be dispatched when player is stalled and run out of attempts, but this is not dispatched as its an internal error. I also tried setting streaming.retryParameters.maxAttempts = 5 and counting the number of HTTP_ERRORs thinking it would line up, but these do not match the number of retries, and the errors stop logging when there is buffer left.

I also see the docs have a page for StallDetector, but did not provide any examples or documentation on how to use it.

Is there not a way to detect if max attempts is reached or that there is no buffer left and we are stalled? Is there a way I can surface the ATTEMPTS_EXHAUSTED error to detect this case?

@lericson-ideanova lericson-ideanova added the type: question A question from the community label Dec 20, 2024
@avelad
Copy link
Member

avelad commented Dec 24, 2024

Currently it is not possible to detect this with any Shaka Player events, I'll leave it to @theodab to decide if we should add this or not.

@shaka-bot
Copy link
Collaborator

@lericson-ideanova Does this answer all your questions? If so, would you please close the issue?

@shaka-bot shaka-bot added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Dec 28, 2024
@avelad avelad removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 2, 2025
@avelad avelad assigned joeyparrish and unassigned theodab Jan 2, 2025
@shaka-bot
Copy link
Collaborator

@lericson-ideanova Does this answer all your questions? If so, would you please close the issue?

@shaka-bot shaka-bot added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 2, 2025
@avelad avelad removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 2, 2025
@lericson-ideanova
Copy link
Author

@avelad Is there a recommended way to detect the stall outside of shaka player events?

@theodab
Copy link
Contributor

theodab commented Jan 16, 2025

The StallDetector is an internal class that is used for the player to detect when it should skip streaming.stallSkip seconds ahead (default 0.1) to automatically try to fix a stall. If a stall is detected, the player fires a stalldetected event (docs). That event will be fired if any stall is detected, including ones that can be resolved automatically.

The ATTEMPTS_EXHAUSTED error is an internal-only error. It is replaced with the error that was experienced with the final network call before being exposed to the developer; for example, a BAD_HTTP_STATUS (1001) error if there was a bad HTTP status, or a TIMEOUT (1003) error if the download timed out. You should be able to intercept these by just adding an event listener for the error event to the player.

Is there some situation you have been having where playback stalls but there is no error event being dispatched?

@avelad avelad added the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 16, 2025
@lericson-ideanova
Copy link
Author

@theodab We want to notify the user of a network error when the stream is unrecoverable and halted. We indeed intercept and receive the network errors but since they dispatch prior to the user experiencing any issues (they are still playing cached content) we don't want to notify the user in case the video recovers in that time. So we are looking for a way to detect when the player has nothing left in the buffer and has given up on retrying.

We considered periodically checking the players progress after a network error to detect when/if comes to a full halt, but I wanted to verify if there was a better solution already in shaka first. However it still seems like that is the best option, although using stalldetected instead of the other network errors.

If you have any other recommendations for us to go about this, it would be much appreciated. Otherwise we will pursue this path and you can close the issue.

Thanks.

@shaka-bot shaka-bot removed the status: waiting on response Waiting on a response from the reporter(s) of the issue label Jan 17, 2025
@martinstark
Copy link
Contributor

martinstark commented Jan 22, 2025

I'm also interested in a feature for detecting this.

Similarly, I'd be interested in a feature that automatically retries until the buffer is exhausted. Currently, if we close the player when it raises a fatal network error, there might still be plenty of buffer left to play, during which we could keep on trying to recover without the user noticing anything ever went wrong.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: question A question from the community
Projects
None yet
Development

No branches or pull requests

6 participants