diff --git a/lib/media/media_source_engine.js b/lib/media/media_source_engine.js index f5a9799736..a4315f9eeb 100644 --- a/lib/media/media_source_engine.js +++ b/lib/media/media_source_engine.js @@ -2066,6 +2066,12 @@ shaka.media.MediaSourceEngine = class { shaka.util.Error.Category.MEDIA, shaka.util.Error.Code.QUOTA_EXCEEDED_ERROR, contentType)); + } else if (!this.isStreamingAllowed()) { + next.p.reject(new shaka.util.Error( + shaka.util.Error.Severity.CRITICAL, + shaka.util.Error.Category.MEDIA, + shaka.util.Error.Code.STREAMING_NOT_ALLOWED, + contentType)); } else { next.p.reject(new shaka.util.Error( shaka.util.Error.Severity.CRITICAL, diff --git a/lib/media/streaming_engine.js b/lib/media/streaming_engine.js index 12c7e283c3..c09d9396a9 100644 --- a/lib/media/streaming_engine.js +++ b/lib/media/streaming_engine.js @@ -1858,6 +1858,10 @@ 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) { diff --git a/lib/util/error.js b/lib/util/error.js index d130969e85..90a3bc07b4 100644 --- a/lib/util/error.js +++ b/lib/util/error.js @@ -521,6 +521,13 @@ shaka.util.Error.Code = { */ 'TRANSMUXING_NO_VIDEO_DATA': 3023, + /** + * A MediaSource operation is not allowed because the streaming is not + * allowed. + *
error.data[0] is the type of content which caused the error. + */ + 'STREAMING_NOT_ALLOWED': 3024, + /** * The Player was unable to guess the manifest type based on file extension