From 3ccf9167b55482c7d1148303be47554ac3eb665d Mon Sep 17 00:00:00 2001 From: 1hitsong <3330318+1hitsong@users.noreply.github.com> Date: Sat, 11 Nov 2023 17:30:06 -0500 Subject: [PATCH 1/3] Add progress bar to pause menu --- components/video/PauseMenu.bs | 13 +++++++++++++ components/video/PauseMenu.xml | 12 +++++++++++- components/video/VideoPlayerView.bs | 6 ++++++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/components/video/PauseMenu.bs b/components/video/PauseMenu.bs index e7b88ecbf..0de67a0cb 100644 --- a/components/video/PauseMenu.bs +++ b/components/video/PauseMenu.bs @@ -7,9 +7,14 @@ sub init() m.inactivityTimer = m.top.findNode("inactivityTimer") m.itemTitle = m.top.findNode("itemTitle") m.videoPlayPause = m.top.findNode("videoPlayPause") + m.videoPositionTime = m.top.findNode("videoPositionTime") + m.videoRemainingTime = m.top.findNode("videoRemainingTime") + m.progressBar = m.top.findNode("progressBar") + m.progressBarBackground = m.top.findNode("progressBarBackground") m.top.observeField("visible", "onVisibleChanged") m.top.observeField("hasFocus", "onFocusChanged") + m.top.observeField("progressPercentage", "onProgressPercentageChanged") m.top.observeField("playbackState", "onPlaybackStateChanged") m.top.observeField("itemTitleText", "onItemTitleTextChanged") @@ -23,6 +28,14 @@ sub init() m.deviceInfo = CreateObject("roDeviceInfo") end sub +' onProgressPercentageChanged: Handler for changes to m.top.progressPercentage param +' +sub onProgressPercentageChanged() + m.videoPositionTime.text = secondsToHuman(m.top.positionTime) + m.videoRemainingTime.text = secondsToHuman(m.top.remainingPositionTime) + m.progressBar.width = m.progressBarBackground.width * m.top.progressPercentage +end sub + ' onPlaybackStateChanged: Handler for changes to m.top.playbackState param ' sub onPlaybackStateChanged() diff --git a/components/video/PauseMenu.xml b/components/video/PauseMenu.xml index 899165927..b51703ce8 100644 --- a/components/video/PauseMenu.xml +++ b/components/video/PauseMenu.xml @@ -10,17 +10,27 @@ - + + + + + +