Skip to content

Commit

Permalink
Update API docs
Browse files Browse the repository at this point in the history
  • Loading branch information
jellyfin-bot committed Nov 16, 2023
1 parent 3c86a43 commit 47ed258
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions docs/api/components_video_VideoPlayerView.bs.html
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,14 @@

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
Expand Down Expand Up @@ -622,6 +630,9 @@

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)
Expand All @@ -630,6 +641,9 @@

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)
Expand All @@ -638,6 +652,9 @@

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
Expand All @@ -651,6 +668,10 @@
' 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"
Expand Down
2 changes: 1 addition & 1 deletion docs/api/data/search.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion docs/api/module-VideoPlayerView.html

Large diffs are not rendered by default.

0 comments on commit 47ed258

Please sign in to comment.