From d20f37266f451f6579f1852fa07ab37daf5190c2 Mon Sep 17 00:00:00 2001 From: ElementalAlchemist Date: Sun, 7 Nov 2021 13:04:47 -0600 Subject: [PATCH] Add a visible error when trying to load a time range with no video content --- thrimbletrimmer/scripts/common.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/thrimbletrimmer/scripts/common.js b/thrimbletrimmer/scripts/common.js index 2da96d5..6650e49 100644 --- a/thrimbletrimmer/scripts/common.js +++ b/thrimbletrimmer/scripts/common.js @@ -80,8 +80,14 @@ async function loadVideoPlayer(playlistURL) { if (data.fatal) { switch (data.type) { case Hls.ErrorTypes.NETWORK_ERROR: - console.log("A fatal network error occurred; retrying", data); - globalPlayer.startLoad(); + if (data.reason === "no level found in manifest") { + addError( + "There is no video data between the specified start and end times. Change the times so that there is video content to play." + ); + } else { + console.log("A fatal network error occurred; retrying", data); + globalPlayer.startLoad(); + } break; case Hls.ErrorTypes.MEDIA_ERROR: console.log("A fatal media error occurred; retrying", data);