Picture in picture (#20)
* Refactor and fix player * Rename functions, fix video loading indicator * Hide loading indicator on exit * Picture in picture, exit dialog, fix spinner * Set launch and input args * Deep linking support * Update changelog * Support dialog multiline * Comments and changelog
This commit is contained in:
1 parent
68a8d61eb0
commit
6ec392a4fe
13 files changed
+197
-28
No files matched your search
@@ -1,3 +1,5 @@
|
||||
import "pkg:/components/VideoPlayer/Video.bs"
|
||||
|
||||
function Init()
|
||||
m.buttonGroup = m.top.findNode("NavBarButtonGroup")
|
||||
m.top.observeField("focusIndex", "OnFocusIndexChange")
|
||||
@@ -7,6 +9,11 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||
if not press
|
||||
return false
|
||||
end if
|
||||
if key = "options"
|
||||
if ToggleVideoPictureInPicture(m.top)
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
if key = "down"
|
||||
i = m.top.focusIndex
|
||||
target = i + 1
|
||||
@@ -31,11 +38,23 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||
m.top.focusIndex = -1
|
||||
return true
|
||||
end if
|
||||
else if key = "back"
|
||||
dialog = ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"])
|
||||
dialog.observeField("buttonSelected", "OnExitDialog", ["buttonSelected"])
|
||||
return true
|
||||
end if
|
||||
|
||||
return false
|
||||
end function
|
||||
|
||||
function OnExitDialog(event as object)
|
||||
buttonIndex = event.GetData()
|
||||
if buttonIndex = 0 ' Exit
|
||||
? "EXITING APP"
|
||||
m.top.GetScene().exitChannel = true
|
||||
end if
|
||||
end function
|
||||
|
||||
function OnFocusIndexChange()
|
||||
focusIndex = m.top.focusIndex
|
||||
childCount = m.buttonGroup.getChildCount()
|
||||
|
||||
Reference in new issue
Block a user