Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
bandal
Visitor

Need help exiting video in videoplayer to go to home screen

I need help on how to get videoplayer with categories and leafs to go back to the Main Screen of Icons after pressing the Back button or the movie stops playing at the end. I do not want to exit the channel, just go to the Home screen.

DA
0 Kudos
5 REPLIES 5
RokuJoel
Binge Watcher

Re: Need help exiting video in videoplayer to go to home scr

You need to return a code (you choose what that code is and its meaning)from the ShowVideoScreen and check the value of that code in the showDetailScreen function and depending on the code, return to the home screen. An example:

in showVideoScreen:

if msg.isScreenClosed()
print "Screen closed"
return -2

in showDetailScreen:

code=showVideoScreen(showList[showIndex])
if code=-2 then
return -2
end if


However it is not standard to return to the top, instead you should return to your springboard screen.

- Joel
0 Kudos
bandal
Visitor

Re: Need help exiting video in videoplayer to go to home scr

Thanks, it is a request from a customer that wants it this way. I agree we should return to the springboard screen.

Update: I tried it but still pops back to the Resume Playing and Play. versus to the main Category Icons.
0 Kudos
RokuJoel
Binge Watcher

Re: Need help exiting video in videoplayer to go to home scr

You need to have every condition that exits the video return a -2, so msg.isfullresult() msg.isrequestfailed() msg.is requestsucceeded() should all return a -2, and of course your test in the showDetailsScreen function should be immediately after the video playback functino returns. Also you'll probably want to modify the showVideoScreen function like:

function showVideoScreen(episode as object) as integer


- Joel
0 Kudos
destruk
Streaming Star

Re: Need help exiting video in videoplayer to go to home scr

It's not standard coding, but you could also simply use the External Control Protocol to re-launch your channel which would 'indubitably' bring them to the home screen rather than stepping up the tree closing all the screens in sequence to the home screen. 🙂
0 Kudos
RokuJoel
Binge Watcher

Re: Need help exiting video in videoplayer to go to home scr

That is so inelegant.

- Joel
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.