Maximize video if playing on channel exit
This commit is contained in:
1 parent
53f8535535
commit
97592f9839
2 files changed
+28
-11
No files matched your search
@@ -82,23 +82,35 @@ function onKeyEvent(key as string, press as boolean) as boolean
|
||||
return false
|
||||
end if
|
||||
if key = "options"
|
||||
VideoUtils.ToggleVideoPictureInPicture()
|
||||
return true
|
||||
if VideoUtils.ToggleVideoPictureInPicture()
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
if key = "play"
|
||||
VideoUtils.TogglePause()
|
||||
if VideoUtils.TogglePause()
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
if key = "pause"
|
||||
VideoUtils.PauseVideo()
|
||||
if VideoUtils.PauseVideo()
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
if key = "playonly"
|
||||
VideoUtils.ResumeVideo()
|
||||
if VideoUtils.ResumeVideo()
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
|
||||
if key = "back"
|
||||
if VideoUtils.IsVideoPlayerOpen() and not VideoUtils.IsVideoPlayerFullScreen()
|
||||
if VideoUtils.ToggleVideoPictureInPicture()
|
||||
return true
|
||||
end if
|
||||
end if
|
||||
dialog = DialogUtils.ShowDialogButtons("Do you want to exit Playlet?", "Exit", ["Exit", "Cancel"])
|
||||
dialog.observeField("buttonSelected", FuncName(OnExitDialog), ["buttonSelected"])
|
||||
return true
|
||||
|
||||
@@ -85,32 +85,37 @@ namespace VideoUtils
|
||||
return GetVideoPlayer() <> invalid
|
||||
end function
|
||||
|
||||
function PauseVideo() as void
|
||||
function PauseVideo() as boolean
|
||||
player = GetVideoPlayer()
|
||||
if player = invalid
|
||||
return
|
||||
return false
|
||||
end if
|
||||
player.control = "pause"
|
||||
return true
|
||||
end function
|
||||
|
||||
function ResumeVideo() as void
|
||||
function ResumeVideo() as boolean
|
||||
player = GetVideoPlayer()
|
||||
if player = invalid
|
||||
return
|
||||
return false
|
||||
end if
|
||||
player.control = "resume"
|
||||
return true
|
||||
end function
|
||||
|
||||
function TogglePause() as void
|
||||
function TogglePause() as boolean
|
||||
player = GetVideoPlayer()
|
||||
if player = invalid
|
||||
return
|
||||
return false
|
||||
end if
|
||||
if player.state = "playing"
|
||||
player.control = "pause"
|
||||
return true
|
||||
else if player.state = "paused"
|
||||
player.control = "resume"
|
||||
return true
|
||||
end if
|
||||
return false
|
||||
end function
|
||||
|
||||
end namespace
|
||||
|
||||
Reference in new issue
Block a user