Set visitor data through launch args
This commit is contained in:
1 parent
c4fe623d17
commit
4926c3df5b
1 file changed
+11
-1
@@ -3,7 +3,6 @@ import "pkg:/source/utils/StringUtils.bs"
|
||||
import "pkg:/source/utils/Types.bs"
|
||||
|
||||
function InitEcpArgs()
|
||||
m.videoQueue = m.top.findNode("VideoQueue")
|
||||
LaunchArgumentsReceived()
|
||||
|
||||
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
|
||||
@@ -29,6 +28,14 @@ function ProcessArguments(args as object) as void
|
||||
return
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(args.visitorData)
|
||||
if m.innertube = invalid
|
||||
m.innertube = m.top.findNode("InnerTube")
|
||||
end if
|
||||
|
||||
m.innertube.visitorData = args.visitorData
|
||||
end if
|
||||
|
||||
if not StringUtils.IsNullOrEmpty(args.contentId) and StringUtils.IsNullOrEmpty(args.videoId)
|
||||
args.videoId = args.contentId
|
||||
end if
|
||||
@@ -43,6 +50,9 @@ function ProcessArguments(args as object) as void
|
||||
if args.timestamp <> invalid
|
||||
node.timestamp = args.timestamp
|
||||
end if
|
||||
if m.videoQueue = invalid
|
||||
m.videoQueue = m.top.findNode("VideoQueue")
|
||||
end if
|
||||
m.videoQueue.playVideo = node
|
||||
end if
|
||||
end function
|
||||
Reference in new issue
Block a user