Skip to content

Commit c2ff501

Browse files
authored
feat: Change the way to handle the STREAMING_NOT_ALLOWED error (#8033)
Related to #7994
1 parent cd32556 commit c2ff501

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

lib/media/streaming_engine.js

+7-4
Original file line numberDiff line numberDiff line change
@@ -1858,10 +1858,6 @@ shaka.media.StreamingEngine = class {
18581858
mediaState.performingUpdate = false;
18591859
this.cancelUpdate_(mediaState);
18601860
this.scheduleUpdate_(mediaState, 0);
1861-
} else if (error.code == shaka.util.Error.Code.STREAMING_NOT_ALLOWED) {
1862-
mediaState.performingUpdate = false;
1863-
this.cancelUpdate_(mediaState);
1864-
this.scheduleUpdate_(mediaState, 0);
18651861
} else if (mediaState.type == ContentType.TEXT &&
18661862
this.config_.ignoreTextStreamFailures) {
18671863
if (error.code == shaka.util.Error.Code.BAD_HTTP_STATUS) {
@@ -2731,6 +2727,13 @@ shaka.media.StreamingEngine = class {
27312727
async handleStreamingError_(mediaState, error) {
27322728
const logPrefix = shaka.media.StreamingEngine.logPrefix_(mediaState);
27332729

2730+
if (error.code == shaka.util.Error.Code.STREAMING_NOT_ALLOWED) {
2731+
mediaState.performingUpdate = false;
2732+
this.cancelUpdate_(mediaState);
2733+
this.scheduleUpdate_(mediaState, 0);
2734+
return;
2735+
}
2736+
27342737
// If we invoke the callback right away, the application could trigger a
27352738
// rapid retry cycle that could be very unkind to the server. Instead,
27362739
// use the backoff system to delay and backoff the error handling.

0 commit comments

Comments
 (0)