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"
|
import "pkg:/source/utils/Types.bs"
|
||||||
|
|
||||||
function InitEcpArgs()
|
function InitEcpArgs()
|
||||||
m.videoQueue = m.top.findNode("VideoQueue")
|
|
||||||
LaunchArgumentsReceived()
|
LaunchArgumentsReceived()
|
||||||
|
|
||||||
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
|
m.scene.ObserveField("inputArgs", FuncName(InputArgumentsReceived))
|
||||||
@@ -29,6 +28,14 @@ function ProcessArguments(args as object) as void
|
|||||||
return
|
return
|
||||||
end if
|
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)
|
if not StringUtils.IsNullOrEmpty(args.contentId) and StringUtils.IsNullOrEmpty(args.videoId)
|
||||||
args.videoId = args.contentId
|
args.videoId = args.contentId
|
||||||
end if
|
end if
|
||||||
@@ -43,6 +50,9 @@ function ProcessArguments(args as object) as void
|
|||||||
if args.timestamp <> invalid
|
if args.timestamp <> invalid
|
||||||
node.timestamp = args.timestamp
|
node.timestamp = args.timestamp
|
||||||
end if
|
end if
|
||||||
|
if m.videoQueue = invalid
|
||||||
|
m.videoQueue = m.top.findNode("VideoQueue")
|
||||||
|
end if
|
||||||
m.videoQueue.playVideo = node
|
m.videoQueue.playVideo = node
|
||||||
end if
|
end if
|
||||||
end function
|
end function
|
||||||
Reference in new issue
Block a user