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

feat: Change the way to handle the STREAMING_NOT_ALLOWED error #8033

Merged
merged 1 commit into from
Feb 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/media/streaming_engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -1858,10 +1858,6 @@ shaka.media.StreamingEngine = class {
mediaState.performingUpdate = false;
this.cancelUpdate_(mediaState);
this.scheduleUpdate_(mediaState, 0);
} else if (error.code == shaka.util.Error.Code.STREAMING_NOT_ALLOWED) {
mediaState.performingUpdate = false;
this.cancelUpdate_(mediaState);
this.scheduleUpdate_(mediaState, 0);
} else if (mediaState.type == ContentType.TEXT &&
this.config_.ignoreTextStreamFailures) {
if (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {
Expand Down Expand Up @@ -2723,6 +2719,13 @@ shaka.media.StreamingEngine = class {
async handleStreamingError_(mediaState, error) {
const logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);

if (error.code == shaka.util.Error.Code.STREAMING_NOT_ALLOWED) {
mediaState.performingUpdate = false;
this.cancelUpdate_(mediaState);
this.scheduleUpdate_(mediaState, 0);
return;
}

// If we invoke the callback right away, the application could trigger a
// rapid retry cycle that could be very unkind to the server. Instead,
// use the backoff system to delay and backoff the error handling.
Expand Down