How to change from one scene to another?
Hi to all
I wish to know if somebody can answer one question, which seems simple but I am not getting to work fine.
I am working in a channel project for a iptv provider.
There are 2 scenes (screen), one of them is the login screen (which will be remake to use Roku Pay) and, when the user has logged in, he will be shown the player screen.
After that, when the user open the channel, if already registered (logged in), he will be presented to the player scene (screen).
Ok, now the bad part:
If the user is logged out (using a remote command - thru the server admin or by another app (Android or IOS), then he will be logged out in the Roku channel and will be presented to the login screen gain.
If he logs in again the channels will not play.
This is caused by the fact that the channel's scenes are being added (the login scene will have 2 instances and the player scene will also have 2 instances working).
the code I use to instantiate the scenes is:
In main.brs:
and, in the HomeScene.brs (player):
In general you only want one roScreen that creates one scene with multiple screens (not to be confused with multiple roScreens). So you'd have a login screen and a home screen under one scene and then change the visibility of those screens as appropriate in your code.
<?xml version="1.0" encoding="utf-8" ?> <component name="home_scene" extends="Scene" initialFocus="login_screen"> <script type="text/brightscript" uri="pkg:/components/home_scene.brs" /> <children> <login_screen id="login_screen" visible="true" translation="[0,0]" /> <home_screen id="home_screen" visible="false" translation="[0,0]" /> </children> </component>
You should note that IPTV channels/apps are highly frowned upon by Roku if the provider can't prove he has the rights to whatever services he's providing. If this is in any way not legitimate I'd stay away from it if I were you.