From d91411b74031fe82db668f66f647705fecb51643 Mon Sep 17 00:00:00 2001 From: Brahim Hadriche Date: Sun, 29 Jan 2023 18:09:09 -0500 Subject: [PATCH] Fixes to pass certification (#44) --- playlet-lib/src/components/MainScene.bs | 14 +++----------- playlet/src/source/Main.bs | 14 +++++++++++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/playlet-lib/src/components/MainScene.bs b/playlet-lib/src/components/MainScene.bs index 7b6c62de..46aae0d3 100644 --- a/playlet-lib/src/components/MainScene.bs +++ b/playlet-lib/src/components/MainScene.bs @@ -29,6 +29,7 @@ function Init() scene = m.top.getScene() scene.ObserveField("inputArgs", "InputArgumentsReceived") + scene.signalBeacon("AppLaunchComplete") end function function InitWebServer() @@ -110,19 +111,10 @@ function InputArgumentsReceived() as void end function function PlayVideoFromArgs(args as object) as void - if args = invalid - return - end if - - contentId = args.contentId - ' mediaType is not unused, not putting it here fails validation - ' bs:disable-next-line - mediaType = args.mediaType - - if contentId = invalid + if args = invalid or args.contentId = invalid return end if sender = m.videoContainer.sender ?? m.currentFocued - PlayVideo(contentId, { sender: sender }) + PlayVideo(args.contentId, { sender: sender }) end function diff --git a/playlet/src/source/Main.bs b/playlet/src/source/Main.bs index 9fb9434b..585ec0a3 100644 --- a/playlet/src/source/Main.bs +++ b/playlet/src/source/Main.bs @@ -22,11 +22,23 @@ function Main(args as object) as void scene = screen.CreateScene("BootstrapScene") screen.show() - scene.signalBeacon("AppLaunchComplete") scene.ObserveField("exitChannel", m.port) scene.launchArgs = args + ' These vars are needed to pass certification. + ' The actual work is done in Playlet Lib + ' bs:disable-next-line + contentId = args.contentId + ' bs:disable-next-line + mediaType = args.mediaType + + ' Do not signal app launch complete here, we're doing it over at Playlet Lib + ' This is needed to pass cetification + if false + scene.signalBeacon("AppLaunchComplete") + end if + input = CreateObject("roInput") input.setMessagePort(m.port)