From 9277bf0556abd165aa2e25881f25e2e0675df398 Mon Sep 17 00:00:00 2001 From: Alex Wardle Date: Tue, 20 Dec 2022 16:55:25 -0700 Subject: [PATCH] pause video when ok button is pressed --- components/JFVideo.brs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/components/JFVideo.brs b/components/JFVideo.brs index 366b3877..728f82f6 100644 --- a/components/JFVideo.brs +++ b/components/JFVideo.brs @@ -222,7 +222,12 @@ end sub function onKeyEvent(key as string, press as boolean) as boolean - if key = "OK" and m.nextEpisodeButton.hasfocus() and not m.top.trickPlayBar.visible + ' don't do anything if trick play bar is visible + if m.top.trickPlayBar.visible + return false + end if + + if key = "OK" and m.nextEpisodeButton.hasfocus() m.top.state = "finished" hideNextEpisodeButton() return true @@ -243,6 +248,16 @@ function onKeyEvent(key as string, press as boolean) as boolean else if key = "up" m.top.selectPlaybackInfoPressed = true return true + else if key = "OK" + print("OK pressed") + ' OK will play/pause depending on current state + if m.top.state = "paused" + m.top.control = "resume" + return true + else if m.top.state = "playing" + m.top.control = "pause" + return true + end if end if return false