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

Rotating banner Ads

Is there a way we could put rotating banner ads on the poster screen? thanks.
0 Kudos
8 REPLIES 8
RokuChris
Roku Employee
Roku Employee

Re: Rotating banner Ads

You could implement something on the server side. Point the adURLs on the poster screen at a script on your servers that has the rotation logic in it and redirects to the appropriate image. You might also have to re-set the adURLs using a timestamp/cachebuster parameter anytime you wanted the banner to change. I've done the first part before, but not the second part. It should definitely be possible.
0 Kudos
uarlive
Visitor

Re: Rotating banner Ads

thanks ill look into it.
0 Kudos
uarlive
Visitor

Re: Rotating banner Ads

so would the timestamp / cachebuster run on the server side or the roku box? thanks.
0 Kudos
gonzotek
Visitor

Re: Rotating banner Ads

"uarlive" wrote:
so would the timestamp / cachebuster run on the server side or the roku box? thanks.

The roku would request a url with a parameter formed similar to this: http://server/rotating-image-script.php?20110318124302
It guarantees that the device (and any possible proxies between it and the server) aren't using cached content. It doesn't have to be a timestamp, just as long as it's reasonably unique. On the server side, you can essentially ignore the timestamp/unique string, and just rotate the ad as desired and return an image when the script is called.

Like RokuChris mentioned, you would need to re-set the adurls in the Roku code for the banner to change without leaving the poster screen(I think, I'm getting beyond my knowledge limit here).
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
uarlive
Visitor

Re: Rotating banner Ads

thanks. the one issue i forgot to mention is the ads are clickable and play a video as well. how would that effect this solution? thanks. the code below is the function that is called from isAdSelected which plays the video ad.

 Sub AdVideo()
videoScreen = CreateObject("roVideoScreen")
port = CreateObject("roMessagePort")
videoScreen.SetMessagePort(port)
episode = {
Stream: { Url: ".mp4"}
StreamFormat: "mp4"
}
videoScreen.SetContent(episode)
videoScreen.Show()
while true
msg = wait(0, videoscreen.GetMessagePort())
if type(msg) = "roVideoScreenEvent" then
if msg.isScreenClosed() then
exit while
endif
endif
end while
End Sub
0 Kudos
gonzotek
Visitor

Re: Rotating banner Ads

"uarlive" wrote:
thanks. the one issue i forgot to mention is the ads are clickable and play a video as well. how would that effect this solution? thanks. the code below is the function that is called from isAdSelected which plays the video ad.

 Sub AdVideo()
videoScreen = CreateObject("roVideoScreen")
port = CreateObject("roMessagePort")
videoScreen.SetMessagePort(port)
episode = {
Stream: { Url: ".mp4"}
StreamFormat: "mp4"
}
videoScreen.SetContent(episode)
videoScreen.Show()
while true
msg = wait(0, videoscreen.GetMessagePort())
if type(msg) = "roVideoScreenEvent" then
if msg.isScreenClosed() then
exit while
endif
endif
end while
End Sub
I don't know if this would be the most efficient way to do it, but I'd probably do a second request, as a roURLTransfer object, and then getToString the id or complete url of the proper video to play. Use the same timestamp/unique string on the request to prevent caching, and the same logic on the server side for deciding when to rotate, only instead of returning the image for the ad, you return a string that your app can use to pull the video. I'd provide example code, but I'm really not strong enough in brightscript to pull it off. There might be a more elegant solution, hopefully someone else can chime in with some code :).
Remoku.tv - A free web app for Roku Remote Control!
Want to control your Roku from nearly any phone, computer or tablet? Get started at http://help.remoku.tv
by Apps4TV - Applications for television and beyond: http://www.apps4tv.com
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: Rotating banner Ads

"uarlive" wrote:
thanks. the one issue i forgot to mention is the ads are clickable and play a video as well. how would that effect this solution? thanks. the code below is the function that is called from isAdSelected which plays the video ad.


Or, to accomplish the same thing without the extra hit to your servers, have your rotation script return a chunk of XML that contains both the banner URLs and the associated video URLs and any other metadata needed for your ad experience.
0 Kudos
uarlive
Visitor

Re: Rotating banner Ads

ok so if i have a php script to rotate the banners and that part works on the server. what do i need to return to setURL to show the banner on the roku box? thanks for all the help. i have tried using html and placing the complete setURL command with image path in the txt file that gets rotated.
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.