Update API docs

This commit is contained in:
jellyfin-bot 2023-11-16 02:55:40 +00:00
parent 3c86a43dee
commit 47ed258ee6
3 changed files with 23 additions and 2 deletions

View File

@ -570,6 +570,14 @@ sub bufferCheck(msg)
end sub
' stateAllowsPauseMenu: Check if current video state allows showing the pause menu
'
' @return {boolean} indicating if video state allows the pause menu to show
function stateAllowsPauseMenu() as boolean
validStates = ["playing", "paused", "stopped"]
return inArray(validStates, m.top.state)
end function
function onKeyEvent(key as string, press as boolean) as boolean
' Keypress handler while user is inside the chapter menu
@ -622,6 +630,9 @@ function onKeyEvent(key as string, press as boolean) as boolean
if key = "down" and not m.top.trickPlayBar.visible
if not m.LoadMetaDataTask.isIntro
' Don't allow user to open menu prior to video loading
if not stateAllowsPauseMenu() then return true
m.pauseMenu.visible = true
m.pauseMenu.hasFocus = true
m.pauseMenu.setFocus(true)
@ -630,6 +641,9 @@ function onKeyEvent(key as string, press as boolean) as boolean
else if key = "up" and not m.top.trickPlayBar.visible
if not m.LoadMetaDataTask.isIntro
' Don't allow user to open menu prior to video loading
if not stateAllowsPauseMenu() then return true
m.pauseMenu.visible = true
m.pauseMenu.hasFocus = true
m.pauseMenu.setFocus(true)
@ -638,6 +652,9 @@ function onKeyEvent(key as string, press as boolean) as boolean
else if key = "OK" and not m.top.trickPlayBar.visible
if not m.LoadMetaDataTask.isIntro
' Don't allow user to open menu prior to video loading
if not stateAllowsPauseMenu() then return true
' Show pause menu, but don't pause video
m.pauseMenu.visible = true
m.pauseMenu.hasFocus = true
@ -651,6 +668,10 @@ function onKeyEvent(key as string, press as boolean) as boolean
' Disable pause menu for intro videos
if not m.LoadMetaDataTask.isIntro
if key = "play" and not m.top.trickPlayBar.visible
' Don't allow user to open menu prior to video loading
if not stateAllowsPauseMenu() then return true
' If video is paused, resume it and don't show pause menu
if m.top.state = "paused"
m.top.control = "resume"

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long