I'm guessing here but this code from the blog entry.... do I place it on the appdetails.brs? And, where does the url go for the pre-roll video?
function ShowPreRoll(video)
' a true result indicates that playback finished without user intervention
' a false result indicates that the user pressed UP or BACK to terminate playback
result = true
canvas = CreateObject("roImageCanvas")
player = CreateObject("roVideoPlayer")
port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
' build a very simple buffer screen for our preroll video
canvas.SetLayer(0, { text: "Your program will begin after this message" })
canvas.Show()
' be sure to use the same message port for both the canvas and the player
' so we can receive events from both
player.SetMessagePort(port)
player.SetDestinationRect(canvas.GetCanvasRect())
player.AddContent(video)
player.Play()
' start our event loop
while true
' wait for an event
msg = wait(0, canvas.GetMessagePort())
if type(msg) = "roVideoPlayerEvent"
if msg.isFullResult()
' the video played to the end without user intervention
exit while
else if isRequestFailed()
' something went wrong with playback, but the user did not intervene
exit while
else if msg.isStatusMessage()
if msg.GetMessage() = "start of play"
' once the video starts, clear out the canvas so it doesn't cover the video
canvas.SetLayer(0, { color: "#00000000", CompositionMode: "Source" })
canvas.Show()
end if
end if
else if type(msg) = "roImageCanvasEvent"
if msg.isRemoteKeyPressed()
index = msg.GetIndex()
if index = 0 or index = 2
' the user pressed UP or BACK to terminate playback
result = false
exit while
end if
end if
end if
end while
player.Stop()
canvas.Close()
return result
end function
And where does this next part of the code go:
' create and display a blank roImageCanvas to prevent the
' underlying UI from flickering between videos
canvas = CreateObject("roImageCanvas")
canvas.SetLayer(0, "#000000")
canvas.Show()
' play the preroll video with trick play disabled
if ShowPreroll(preroll)
' only play the main content if the preroll completed without user intervention
ShowVideoScreen(content)
end if
' close the blank canvas and return the user to the previous UI screen
canvas.Close()
http://www.victoryNOWfilmsandtv.com