"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