From dd00fdf0de5fa47fa8c8f5a417369c67f3535e13 Mon Sep 17 00:00:00 2001 From: c21021 Date: Tue, 12 Nov 2024 16:29:35 -0500 Subject: [PATCH 1/2] Allow Intro Videos to be able to be skipped or paused --- components/video/VideoPlayerView.bs | 56 ++++++++++++----------------- 1 file changed, 23 insertions(+), 33 deletions(-) diff --git a/components/video/VideoPlayerView.bs b/components/video/VideoPlayerView.bs index 7fd76714b..472279fab 100644 --- a/components/video/VideoPlayerView.bs +++ b/components/video/VideoPlayerView.bs @@ -438,13 +438,9 @@ sub onVideoContentLoaded() populateChapterMenu() - if m.LoadMetaDataTask.isIntro - ' Disable trackplay bar for intro videos - m.top.enableTrickPlay = false - else - ' Allow custom captions for non intro videos - m.top.allowCaptions = true - end if + + ' Allow custom captions for all videos including intro videos + m.top.allowCaptions = true ' Allow default subtitles m.top.unobserveField("selectedSubtitle") @@ -847,40 +843,34 @@ function onKeyEvent(key as string, press as boolean) as boolean end if else if key = "OK" and not m.top.trickPlayBar.visible - if not m.LoadMetaDataTask.isIntro - ' Don't allow user to open menu prior to video loading - if not stateAllowsOSD() then return true - - ' Show OSD, but don't pause video - m.osd.visible = true - m.osd.hasFocus = true - m.osd.setFocus(true) - return true - end if + ' Don't allow user to open menu prior to video loading + if not stateAllowsOSD() then return true - return false + ' Show OSD, but don't pause video + m.osd.visible = true + m.osd.hasFocus = true + m.osd.setFocus(true) + return true end if ' Disable OSD for intro videos - if not m.LoadMetaDataTask.isIntro - if key = "play" and not m.top.trickPlayBar.visible - - ' Don't allow user to open menu prior to video loading - if not stateAllowsOSD() then return true + if key = "play" and not m.top.trickPlayBar.visible - ' If video is paused, resume it and don't show OSD - if m.top.state = "paused" - m.top.control = "resume" - return true - end if + ' Don't allow user to open menu prior to video loading + if not stateAllowsOSD() then return true - ' Pause video and show OSD - m.top.control = "pause" - m.osd.visible = true - m.osd.hasFocus = true - m.osd.setFocus(true) + ' If video is paused, resume it and don't show OSD + if m.top.state = "paused" + m.top.control = "resume" return true end if + + ' Pause video and show OSD + m.top.control = "pause" + m.osd.visible = true + m.osd.hasFocus = true + m.osd.setFocus(true) + return true end if if key = "back" From 928b1da0c04cea482b10f589839cfdb05f4a30eb Mon Sep 17 00:00:00 2001 From: c21021 Date: Tue, 12 Nov 2024 17:37:57 -0500 Subject: [PATCH 2/2] Removed other restrictions on OSD for intro files --- components/video/VideoPlayerView.bs | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/components/video/VideoPlayerView.bs b/components/video/VideoPlayerView.bs index 472279fab..e6cb34996 100644 --- a/components/video/VideoPlayerView.bs +++ b/components/video/VideoPlayerView.bs @@ -821,26 +821,22 @@ function onKeyEvent(key as string, press as boolean) as boolean if not press then return false if key = "down" and not m.top.trickPlayBar.visible - if not m.LoadMetaDataTask.isIntro - ' Don't allow user to open menu prior to video loading - if not stateAllowsOSD() then return true + ' Don't allow user to open menu prior to video loading + if not stateAllowsOSD() then return true - m.osd.visible = true - m.osd.hasFocus = true - m.osd.setFocus(true) - return true - end if + m.osd.visible = true + m.osd.hasFocus = true + m.osd.setFocus(true) + return true else if key = "up" and not m.top.trickPlayBar.visible - if not m.LoadMetaDataTask.isIntro - ' Don't allow user to open menu prior to video loading - if not stateAllowsOSD() then return true + ' Don't allow user to open menu prior to video loading + if not stateAllowsOSD() then return true - m.osd.visible = true - m.osd.hasFocus = true - m.osd.setFocus(true) - return true - end if + m.osd.visible = true + m.osd.hasFocus = true + m.osd.setFocus(true) + return true else if key = "OK" and not m.top.trickPlayBar.visible ' Don't allow user to open menu prior to video loading