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: 
newchannel
Roku Guru

Help on the following please:

Hi,

I need to find out how to do the following. Can you lead me in the right direction?


1. If hit resume after watching a few moments of a video, viewer has to sit through the preroll ads again. How to do a time-delay, so the user can stop, resume (say, if the phone rings) without having to sit through the ads again?

2. I used roVideoScreen instead of roVideoPlayer. I understand with roVideoPlayer I can prevent viewers from being able to fast-forward through the preroll ads and overlay the word "Advertisement:" on the top of the screen so people know it isn't the main content yet. How do I change over? I've already built the channel and it's working and worried if I make too many changes I will break it for sure so how to change over to roVideoPlayer. OR is there an easier way to implement this with less changes?

3. Content ID: I have not done anything with the content ID line. How are you using this?

Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
1 REPLY 1
RokuJoel
Binge Watcher

Re: Help on the following please:

Hi,

"newchannel" wrote:
1. If hit resume after watching a few moments of a video, viewer has to sit through the preroll ads again. How to do a time-delay, so the user can stop, resume (say, if the phone rings) without having to sit through the ads again?


I would create a global timer for this, so it is visible everywhere in the channel:

m.timer=createobject("rotimespan")
m.timer.mark()


Then in your code where the resume is called you would do something like:


if m.timer.totalseconds() > 300 and then
showprerollAds()
end if


That way, it would only show the advertisement on resume if more than 5 minutes.

in your video playback function's if/then statement, you could add:

else if msg.isStreamStarted() then
m.timer.mark() 'reset the timer


"newchannel" wrote:

2. I used roVideoScreen instead of roVideoPlayer. I understand with roVideoPlayer I can prevent viewers from being able to fast-forward through the preroll ads and overlay the word "Advertisement:" on the top of the screen so people know it isn't the main content yet. How do I change over? I've already built the channel and it's working and worried if I make too many changes I will break it for sure so how to change over to roVideoPlayer. OR is there an easier way to implement this with less changes?


You might try to just copy the VAST_VideoScreen.brs out of this: https://roku.box.com/s/khutav29hecfplnm9nid preroll demo and hack it into your app, possibly just copy the ShowPreRoll function and in the place where you currently call video playback for your advertisements, call ShowPreRoll

"newchannel" wrote:
3. Content ID: I have not done anything with the content ID line. How are you using this?


This needs to be a unique value for each (non-advertisement) video, it can be a number or text, but it should be short so as not to fill up the Registry with extra data. Typically it would be a string like:

<ContentID>A5342</ContentID>


but it has to be different for each video, otherwise if a user goes to another video that has not been played yet, it will resume from where the last played video left off.

- 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.