Files
playlet-piped/playlet-lib/src/components/EcpArgs.bs
T
Brahim Hadricheandgithub-action linter c740d5e0a0 Bookmarks (#153)
* Empty bookmarks screen

* Bookmarks object

* Long press support

* Lint fix

* Context menu v1

* A working context menu

* Basic bookmarks in context menu

* Use a root content node for bookmarks

* context menu animation

* small tweak

* move logger around, adjust animation

* Lint fix

* Restore logger fix

* Cache channel info

* Bookmarks v1

* Added comment

* Adjust "popular" feed error handling

* Progress with bookmarks

* Add todo

* add todo

* handle roDateTime logging

* logger adjustment

* Use yaml for api and layout

* rename requestData to feedSource

* Restructure things

* Lint fix

* remove comment

* introduce feedSource id

* small cleanup

* playlist context menu

* Context menu for the channel view

* changelog

---------

Co-authored-by: github-action linter <githubaction@githubaction.com>
2023-10-19 19:16:27 -04:00

52 lines
1.4 KiB
Plaintext

import "pkg:/components/VideoPlayer/VideoUtils.bs"
import "pkg:/source/utils/Logging.bs"
import "pkg:/source/utils/StringUtils.bs"
import "pkg:/source/utils/Types.bs"
function InitEcpArgs()
m.playQueue = m.top.findNode("PlayQueue")
LaunchArgumentsReceived()
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
if m.scene.inputArgs <> invalid
InputArgumentsReceived()
end if
end function
function LaunchArgumentsReceived() as void
launchArgs = m.scene.launchArgs
LogInfo("LaunchArgumentsReceived", launchArgs)
ProcessArguments(launchArgs)
end function
function InputArgumentsReceived() as void
inputArgs = m.scene.inputArgs
LogInfo("InputArgumentsReceived", inputArgs)
ProcessArguments(inputArgs)
end function
function ProcessArguments(args as object) as void
if args = invalid
return
end if
if not StringUtils.IsNullOrEmpty(args.contentId) and args.mediaType = "video"
if StringUtils.IsNullOrEmpty(args.videoId)
args.videoId = args.contentId
end if
end if
if args.timestamp <> invalid
args.timestamp = args.timestamp.ToInt()
end if
if not StringUtils.IsNullOrEmpty(args.videoId)
node = CreateObject("roSGNode", "VideoContentNode")
node.videoId = args.videoId
if args.timestamp <> invalid
node.timestamp = args.timestamp
end if
m.playQueue@.Play(node, -1)
end if
end function