Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Close dialog when casting a video #85

Merged
merged 3 commits into from
Jun 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions playlet-lib/src/components/MainScene.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions playlet-lib/src/components/SettingsScreen/BooleanControl.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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
3 changes: 1 addition & 2 deletions playlet-lib/src/components/SettingsScreen/RadioControl.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
15 changes: 10 additions & 5 deletions playlet-lib/src/components/SettingsScreen/StringControl.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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
1 change: 1 addition & 0 deletions playlet-lib/src/components/VideoPlayer/Video.bs
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down