diff --git a/CHANGELOG.md b/CHANGELOG.md index b2161396..de29e8ff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Subscriber count in the channel page +### Fixed + +- A bug where videos that did not premiere yet would error with a playback error +- A bug where a playback error dialog is dismissed too fast before playing the next video + ## [0.21.0] - 2024-03-07 ### Added diff --git a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs index 15d533fd..41fbaedf 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoContentTask.bs @@ -36,6 +36,16 @@ function VideoContentTask(input as object) as object contentNode.secondaryTitle = metadata.author contentNode.live = metadata.liveNow + if IsString(metadata.error) + ' Adding metadata allows us to play next recommended video after displaying the error + contentNode.addFields({ metadata: metadata }) + + return { + success: false + error: metadata.error + } + end if + streamUrls = CreateStreamUrls(metadata, service, preferencesNode, playletServerPort) contentNode.url = streamUrls[0] diff --git a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs index 3c02d8a1..285667ac 100644 --- a/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs +++ b/playlet-lib/src/components/VideoPlayer/VideoPlayer.bs @@ -25,7 +25,9 @@ function Init() m.videoPlayingSuccess = false ' ignoreNextFinishedState indicates if we should ignore the next finished state ' This is used to prevent the video from playing the next video when we are - ' still trying to find a working stream url + ' still trying to find a working stream url. + ' This is also used to prevent playing the next video when we're still displaying + ' an error dialog. m.ignoreNextFinishedState = false ' Indicates that we're currently paused and seeking position @@ -266,6 +268,7 @@ function OnVideoPlayerStateChange() as void dialog = DialogUtils.ShowTimedDialogButtons(messageLines, title, ["Play next video", "Cancel"], 0, 10, true) dialog.observeFieldScoped("wasClosed", FuncName(OnVideoContentTaskErrorDialogResponse)) + m.ignoreNextFinishedState = true end if end function