From 1964afc7f12659fe9611fc5b8047dd34a4a05260 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 25 Jun 2023 03:45:04 -0400 Subject: [PATCH 1/3] Close dialog when casting a video --- playlet-lib/src/components/MainScene.bs | 6 ++++++ playlet-lib/src/components/VideoPlayer/Video.bs | 1 + 2 files changed, 7 insertions(+) diff --git a/playlet-lib/src/components/MainScene.bs b/playlet-lib/src/components/MainScene.bs index 1e1757a6..6ab17eb3 100644 --- a/playlet-lib/src/components/MainScene.bs +++ b/playlet-lib/src/components/MainScene.bs @@ -116,6 +116,12 @@ end function function OnWebServerCommand() if m.serverTask.command.StartsWith("play:") sender = m.videoContainer.sender ?? m.currentFocued + if m.videoContainer.fullscreen + dialog = m.top.getScene().dialog + if dialog <> invalid + dialog.close = true + end if + end if PlayVideo(m.serverTask.command.Mid(5), { sender: sender }) end if end function diff --git a/playlet-lib/src/components/VideoPlayer/Video.bs b/playlet-lib/src/components/VideoPlayer/Video.bs index fceed8fc..0a339755 100644 --- a/playlet-lib/src/components/VideoPlayer/Video.bs +++ b/playlet-lib/src/components/VideoPlayer/Video.bs @@ -55,6 +55,7 @@ function CloseVideo(setFocus = true as boolean) videoContainer.sender.SetFocus(true) end if end if + videoContainer.sender = invalid SponsorBlockNotifcationSetVisible(false) end function From d044279ba250b326ad6568d994a32d994a558ff4 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 25 Jun 2023 03:47:25 -0400 Subject: [PATCH 2/3] Refactor, and fix issue with keyboard dialog --- .../components/SettingsScreen/BooleanControl.bs | 3 +-- .../SettingsScreen/ClearSearchHistoryControl.bs | 3 +-- .../src/components/SettingsScreen/RadioControl.bs | 3 +-- .../components/SettingsScreen/StringControl.bs | 15 ++++++++++----- 4 files changed, 13 insertions(+), 11 deletions(-) diff --git a/playlet-lib/src/components/SettingsScreen/BooleanControl.bs b/playlet-lib/src/components/SettingsScreen/BooleanControl.bs index b26e7ffb..02d7292e 100644 --- a/playlet-lib/src/components/SettingsScreen/BooleanControl.bs +++ b/playlet-lib/src/components/SettingsScreen/BooleanControl.bs @@ -38,6 +38,5 @@ function OnFocusChanged() end function function OnkeyEvent(key as string, press as boolean) as boolean - settingsScreen = m.top.getScene().findNode("SettingsScreen") - return settingsScreen@.OnkeyEvent(key, press) + return m.top.settings@.OnkeyEvent(key, press) end function diff --git a/playlet-lib/src/components/SettingsScreen/ClearSearchHistoryControl.bs b/playlet-lib/src/components/SettingsScreen/ClearSearchHistoryControl.bs index 311adfde..d89160f2 100644 --- a/playlet-lib/src/components/SettingsScreen/ClearSearchHistoryControl.bs +++ b/playlet-lib/src/components/SettingsScreen/ClearSearchHistoryControl.bs @@ -34,6 +34,5 @@ function OnDialogButtonSelected() end function function OnkeyEvent(key as string, press as boolean) as boolean - settingsScreen = m.top.getScene().findNode("SettingsScreen") - return settingsScreen@.OnkeyEvent(key, press) + return m.top.settings@.OnkeyEvent(key, press) end function diff --git a/playlet-lib/src/components/SettingsScreen/RadioControl.bs b/playlet-lib/src/components/SettingsScreen/RadioControl.bs index bee150da..996a0e0e 100644 --- a/playlet-lib/src/components/SettingsScreen/RadioControl.bs +++ b/playlet-lib/src/components/SettingsScreen/RadioControl.bs @@ -47,8 +47,7 @@ function OnFocusChanged() end function function OnkeyEvent(key as string, press as boolean) as boolean - settingsScreen = m.top.getScene().findNode("SettingsScreen") - return settingsScreen@.OnkeyEvent(key, press) + return m.top.settings@.OnkeyEvent(key, press) end function function OnOptionsChanged() diff --git a/playlet-lib/src/components/SettingsScreen/StringControl.bs b/playlet-lib/src/components/SettingsScreen/StringControl.bs index fd85ebd4..686923f9 100644 --- a/playlet-lib/src/components/SettingsScreen/StringControl.bs +++ b/playlet-lib/src/components/SettingsScreen/StringControl.bs @@ -3,6 +3,7 @@ function Init() m.top.observeField("focusedChild", "OnFocusChanged") m.top.observeField("value", "OnValueChanged") m.top.observeField("settings", "OnSettingsScreen") + m.keyboardWasClosedByButton = false end function function OnSettingsScreen() @@ -23,8 +24,7 @@ function OnValueChanged() end function function OnkeyEvent(key as string, press as boolean) as boolean - settingsScreen = m.top.getScene().findNode("SettingsScreen") - return settingsScreen@.OnkeyEvent(key, press) + return m.top.settings@.OnkeyEvent(key, press) end function function ShowEditKeyboard() @@ -45,10 +45,15 @@ function OnButtonSelected(event as object) if buttonSelected = 0 m.top.value = keyboard.text end if + m.keyboardWasClosedByButton = true keyboard.close = true end function -function OnKeyboardClosed() - settingsScreen = m.top.getScene().findNode("SettingsScreen") - settingsScreen@.MenuNavigate(-1) +function OnKeyboardClosed() as void + ' The keyboard was closed by something else (like cast from web app) + ' In this case, we do nothing, since the focus might be moved to the video player + if not m.keyboardWasClosedByButton + return + end if + m.top.settings@.MenuNavigate(-1) end function From 8df2017fedd55595d2dc65f1960a8b227758cd8f Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 25 Jun 2023 03:48:24 -0400 Subject: [PATCH 3/3] Changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07102b99..1b31e02c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added launch argument `clearPlayletLibUrls` - If the dev menu is used to load a custom Playlet lib url, but the lib does not have a functionality to revert back, `curl -d '' "http://$ROKU_DEV_TARGET:8060/launch/dev?clearPlayletLibUrls=true"` can be used to remove the custom lib, and revert to using default. +### Fixed + +- Issue where a dialog remains on screen when a video was cast from web app + ### Changed - SponsorBlock segments are not skipped by default, except for sponsor segments