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

PHP question

My banners ads are php on a 2nd server. Like the other images on the channel, I have HD and SD banner images. My question is how do I add both HD and SD banner images to the php?

An example of one line in php is:

$bannerCode[$bannerCounter] = 'http://www.xxxxxxx/xxxx/images/xxxxxxx540x60.png,http://xxxx.com/vid/xxxxx.m4v';

Also, I just noticied tonight that when I click a static banner ad it exits the channel. (Not the same line of code as I have above..static of course is minus the video url.) It used to be okay and just do nothing. Any one else have this happen?


Thank you.
http://www.victoryNOWfilmsandtv.com
0 Kudos
3 REPLIES 3
RokuRobB
Streaming Star

Re: PHP question

Your PHP script would need to know which version of the banner to serve up. Add a parameter to the PHP script for the display type. Then int the channel BrightScript code, you can determine the display type by creating an roDeviceInfo component, calling the GetDeviceType() function, and using the result of that call to decide what value (HD or SD) to send to your PHP script in that new parameter.
0 Kudos
newchannel
Roku Guru

Re: PHP question

Sorry for the delay in answering.

Thank you for the information on this.
http://www.victoryNOWfilmsandtv.com
0 Kudos
RokuKevin
Visitor

Re: PHP question

The Brightscript SDK is setup so that you always supply both and HD and SD asset wherever an image is specified. The firmware then requests to download the appropriate asset based on the current display setting on the Roku box.

The PHP code should make both HD and SD urls available for a banner ad in your feeds.

The Brightscript code on the Roku will set the banner ad on a springboard or poster screen with the method SetAdURL(sdAdUrl, hdAdUrl)

--Kevin
0 Kudos