Fix video selection bug (#419)
* Fix video selection bug * Refactor key handling * comment
This commit is contained in:
1 parent
896d0b9bf3
commit
ebc5d81180
28 files changed
+216
-160
No files matched your search
@@ -1,3 +1,4 @@
|
||||
import "pkg:/source/utils/RemoteKeys.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function Init()
|
||||
@@ -41,12 +42,12 @@ function OnDisabledChange()
|
||||
m.top.focusable = not disabled
|
||||
end function
|
||||
|
||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
function OnKeyEvent(key as string, press as boolean) as boolean
|
||||
if not press
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = "OK"
|
||||
if key = RemoteKeys.Ok
|
||||
disabled = m.top.disabled
|
||||
if not disabled
|
||||
m.top.buttonSelected = true
|
||||
|
||||
@@ -6,6 +6,7 @@ import "pkg:/source/utils/DisposableObserve.bs"
|
||||
import "pkg:/source/utils/ErrorUtils.bs"
|
||||
import "pkg:/source/utils/FocusManagement.bs"
|
||||
import "pkg:/source/utils/Logging.bs"
|
||||
import "pkg:/source/utils/RemoteKeys.bs"
|
||||
import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
@@ -52,15 +53,15 @@ function OnNodeReady()
|
||||
DisposableObserveField(m.progressTimer, "fire", FuncName(OnProgress))
|
||||
DisposableObserveField(m.hideVideoUiTimer, "fire", FuncName(OnHideVideoUiTimer))
|
||||
|
||||
SetNavigation(m.previousButton, "right", m.playButton)
|
||||
SetNavigation(m.playButton, "right", m.nextButton)
|
||||
SetNavigation(m.nextButton, "right", m.minimizeButton)
|
||||
SetNavigation(m.playButton, "right", m.minimizeButton)
|
||||
SetNavigation(m.previousButton, RemoteKeys.Right, m.playButton)
|
||||
SetNavigation(m.playButton, RemoteKeys.Right, m.nextButton)
|
||||
SetNavigation(m.nextButton, RemoteKeys.Right, m.minimizeButton)
|
||||
SetNavigation(m.playButton, RemoteKeys.Right, m.minimizeButton)
|
||||
|
||||
SetNavigation(m.minimizeButton, "left", m.nextButton)
|
||||
SetNavigation(m.minimizeButton, "left", m.playButton)
|
||||
SetNavigation(m.nextButton, "left", m.playButton)
|
||||
SetNavigation(m.playButton, "left", m.previousButton)
|
||||
SetNavigation(m.minimizeButton, RemoteKeys.Left, m.nextButton)
|
||||
SetNavigation(m.minimizeButton, RemoteKeys.Left, m.playButton)
|
||||
SetNavigation(m.nextButton, RemoteKeys.Left, m.playButton)
|
||||
SetNavigation(m.playButton, RemoteKeys.Left, m.previousButton)
|
||||
|
||||
if m.top.hasFocus() and m.videoUi.visible and m.videoUi.opacity = 1
|
||||
NodeSetFocus(m.playButton, true)
|
||||
@@ -145,7 +146,7 @@ function OnClose()
|
||||
m.top.dispose = true
|
||||
end function
|
||||
|
||||
function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
function OnKeyEvent(key as string, press as boolean) as boolean
|
||||
m.hideVideoUiTimer.control = "stop"
|
||||
m.hideVideoUiTimer.control = "start"
|
||||
if ShowVideoUi()
|
||||
@@ -160,7 +161,7 @@ function OnkeyEvent(key as string, press as boolean) as boolean
|
||||
return false
|
||||
end if
|
||||
|
||||
if key = "back"
|
||||
if key = RemoteKeys.Back
|
||||
m.videoQueue.closePlayer = true
|
||||
return true
|
||||
end if
|
||||
|
||||
Reference in new issue
Block a user