Your Digital Media Has Never Looked So Good

 
rontom974
Topic Author
Posts: 9
Joined: Sun Nov 15, 2015 8:11 pm

Roku Autoplay Video Function

Fri Aug 19, 2016 6:55 pm

Hi, i have a roku application
i need some help adding autoplay video function
once the video completes it need to select the next video and play automatically after showing 
a message like "your next video will be resume in 5 seconds."
how can i do that ?
 
belltown
Posts: 1461
Joined: Thu Dec 09, 2010 1:43 pm
Contact:

Re: Roku Autoplay Video Function

Fri Aug 19, 2016 7:44 pm

For a general idea of how to do that, take a look at https://github.com/belltown/Roku-NewVideoPlayer/blob/master/source/UI.brs, specifically the uiDisplayVideoDetails function starting on line 300, and the uiPlayVideo function that starts on line 420. The code implements Play/Resume, Play from beginning, and Play all for a list of videos. If you can generally understand what the code is doing then you should have no trouble implementing your own solution.
https://github.com/belltown/
 
norcaljohnny
Posts: 60
Joined: Thu Apr 13, 2017 11:00 pm

Re: Roku Autoplay Video Function

Wed Jan 23, 2019 12:28 am

You need to set up an on video state function for instance:


If (m.video.state = "playing")
 if m.video.duration = m.video.duration - 5 then
   m.yourCustomLabel.text = "Your video will resume in 5 seconds"
 end if
end if

If (m.video.state = "finished")
  m.video.control = "stop"
  m.videocontent = m.yourVideoList.content.getChild(1)
  m.video.content = m.videocontent
  m.yourCustomLabel.text = ""
  m.video.control = "play"
end if
 
destruk
Posts: 2629
Joined: Sat Dec 18, 2010 4:58 pm

Re: Roku Autoplay Video Function

Thu Jan 24, 2019 9:15 am

This thread is from 2016...
 
norcaljohnny
Posts: 60
Joined: Thu Apr 13, 2017 11:00 pm

Re: Roku Autoplay Video Function

Thu Feb 07, 2019 9:43 pm

destruk wrote:
This thread is from 2016...

Yes true but it seems a lot of people still have trouble with this...?

Who is online

Users browsing this forum: No registered users and 3 guests