From daf7966f4bec2198fb9ba15f01eb159f6b926a52 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sat, 6 Sep 2025 23:22:52 -0400 Subject: [PATCH] Small tweak --- playlet-lib/src/components/VideoPlayer/VideoContentJob.bs | 3 +-- playlet-lib/src/components/VideoPlayer/VideoPlayer.bs | 4 ++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs b/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs index 6d7c2e3e..b27114dc 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentJob.bs @@ -126,7 +126,7 @@ function CreateStreamUrls(metadata as object, service as Invidious.InvidiousServ streamUrls = [] - if metadata.hlsUrl <> invalid + if not StringUtils.IsNullOrEmpty(metadata.hlsUrl) metadata.hlsUrl = AddInstanceToUrlIfNeeded(metadata.hlsUrl, instance) AddHlsUrls(streamUrls, metadata, preferredQuality, backend, proxyVideos, playletServerPort) else @@ -248,7 +248,6 @@ function SetCaptions(metadata as object, service as object, contentNode as objec return end if - ' TODO:P2 we don't need to read and parse this every time isoLanguageList = ParseJson(ReadAsciiFile("libpkg:/config/ISO-639-1-to-ISO-639-2T.json5")) instance = service.GetInstance() diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 8bdc02a4..92051bb3 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -462,6 +462,10 @@ function OnVideoPlayerStateChange() as void nextUrl = playletStreamUrls[playletStreamUrlIndex] LogError(`Stream ${currentUrl} failed to play. Trying next stream ${nextUrl}`) + if StringUtils.IsNullOrEmpty(nextUrl) + LogError("Next stream URL is empty, cannot try next stream") + end if + content.url = nextUrl SeekToInitialPosition(content)