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: 
lmagnif
Visitor

Adding Preroll Advertisements to VideoPlayer Template

This is Louis and Char Magnifico from The Traveling Twosome (www.TheTravelingTwosome.com). We have a Roku TV Channel, "The Traveling Twosome Channel." We are trying to incorporate our own commercials (preroll) into our videos and have built our channel based on the VideoPlayer template in the SDK. You can add our public channel via the Channel Store or at https://owner.roku.com/add/thetravelingtwosome

It has been recommended that we use VAST and Roku has sent me a VERY brief PDF about how to do so... however, it wasn't very verbose and we've run into a couple questions.

If VAST is what we need to do, then fine... but I'm not sure we need to do that. All we want to do is have a short commercial video played before whatever video is selected to be played. I don't want to have to repackage or republish every time we acquire a new commercial ad. I'd like to just be able to update an XML file (ideally, the same XML file that calls the video being selected if that's possible). We'd like to be able to choose what ad is played before what content.

For example, let's say we've got a video where Char is in the Wonder Woman costume wrestling Louis in the ring. There is a costume company in Los Angeles that has a commercial... a great video for them to run their commercial on would be the one where we are wrestling each other where the Wonder Woman costume is being worn. So I'd like to be able to just put it there before that video. Likewise, the Hot Springs Tourism Commission would likely want to run a commercial on our TV Show episode, "A Day in the Life of Hot Springs."

If we could get away with this without running off of an ad server or having to use VAST but rather just hosting the commercials on the same server that the channel's videos are on and do a simple edit to VideoPlayer to make this happen, that would be ideal. We'd just have two requirements:

1) the commercial video couldn't be skipped prior to playing the main video
and
2) the main video would play right after the commercial is over.

Sounds easy, right? I can't find documentation ANYWHERE to tell me how to do this.

If any of you can help, we'd REALLY APPRECIATE IT! If you had something to promote, perhaps we could even put you on our radio show as a guest to promote it in exchange for helping us on this matter. At the very least, we could send you a free autographed copy of our new book.

Thanks - let us know if you can help.

Louis and Char Magnifico
The Traveling Twosome
www.TheTravelingTwosome.com
0 Kudos
3 REPLIES 3
RokuChris
Roku Employee
Roku Employee

Re: Adding Preroll Advertisements to VideoPlayer Template

"lmagnif" wrote:
If VAST is what we need to do, then fine... but I'm not sure we need to do that. All we want to do is have a short commercial video played before whatever video is selected to be played. I don't want to have to repackage or republish every time we acquire a new commercial ad. I'd like to just be able to update an XML file (ideally, the same XML file that calls the video being selected if that's possible). We'd like to be able to choose what ad is played before what content.


That's almost exactly what VAST does, VAST is just an XML schema (http://www.iab.net/guidelines/508676/di ... /vast_copy). Each time you want to play an ad, your channel will make a request to your (or your ad provider's) cloud service for a chunk of VAST defining the ad to be played. No need to update your channel for each new ad you put in the system.

You could use your own schema to define your ads if you wanted, but you'd also have to write the BrightScript to parse it. If you go with VAST, you can use the library included with the VAST template channel.

"lmagnif" wrote:
1) the commercial video couldn't be skipped prior to playing the main video
and
2) the main video would play right after the commercial is over.

Sounds easy, right? I can't find documentation ANYWHERE to tell me how to do this.


I think this blog post addresses both those issues: http://blog.roku.com/developer/2011/06/ ... r-channel/
0 Kudos
lmagnif
Visitor

Re: Adding Preroll Advertisements to VideoPlayer Template

Thank you for the reply - it sounds like I will certainly use VAST, then. But I still don't understand how to incorporate VAST into my channel based on the VideoPlayer template. Here's what I've done so far:

I copied the three files that I was sent from Roku (in the VAST template) to my channel package based on VideoPlayer template (the three files were NWM_VAST.brs, VAST_VideoScreen.brs, and NWM_Utilities.brs). I did not edit them at all, just copied them to my folder which I will publish once finished.

Next, I added the following code to my Main.brs file which, again, was part of the VideoPlayer template:

vast = NWM_VAST()
video.preroll = vast.GetPrerollFromURL("http://www.thetravelingtwosome.com/thetravelingtwosomechannel/vast.xml")

That's all I've done... notice the xml path in that code was what I customized. Everything else was left just as it was. So my two questions are: #1) is there anything else I need to do at all and #2) how should my XML file be formatted? I looked at some sample VAST XML files on a Google search but they did not help at ALL. I need to know exactly what is needed in such an XML file that will just pull from my own web server a commercial to be played before the video.

Once that is all figured out, I have to ask... how does it know what commercials to play where? Where do I put that info?

I feel I'm getting close but just need these final questions answered so I'll know how to proceed...

Louis
0 Kudos

Re: Adding Preroll Advertisements to VideoPlayer Template

You know I need those files as well how can I get them?
0 Kudos