winningsheen
14 years agoVisitor
Pre Roll Screen?
Hi.. I've stripped out some of the functionality from the Roku blog for the pre roll video. I just need this to display at the start of the channel. Here is my appMain.brs. It plays the video, the home screen doesn't load after.
Any help would be appreciated! Thanks! 😄
'********************************************************************
'** Video Player Example Application - Main
'** November 2009
'** Copyright (c) 2009 Roku Inc. All Rights Reserved.
'********************************************************************
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
CanvasPreroll=CreateObject("roImageCanvas")
Port=CreateObject("roMessagePort")
CanvasPreroll.SetMessagePort(Port)
' build a very simple buffer screen for our preroll video
CanvasPreroll.SetLayer()
CanvasPreroll.Close()
' be sure to use the same message port for both the canvas and the player
' so we can receive events from both
End Function
Sub Main()
'initialize theme attributes like titles, logos and overhang color
initTheme()
preroll = {
streamFormat: "mp4"
stream: {
url: "http://www.archive.org/download/kelloggs_variety_pak/kelloggs_variety_pak_512kb.mp4"
}
}
ShowVideoScreen(preroll)
'prepare the screen for display and get ready to begin
screen=preShowHomeScreen("", "")
'set to go, time to get started
if screen=invalid then
print "unexpected error in preShowHomeScreen"
return
end if
showHomeScreen(screen)
End Sub
'*************************************************************
'** Set the configurable theme attributes for the application
'**
'** Configure the custom overhang and Logo attributes
'** Theme attributes affect the branding of the application
'** and are artwork, colors and offsets specific to the app
'*************************************************************
Sub initTheme()
app = CreateObject("roAppManager")
theme = CreateObject("roAssociativeArray")
theme.OverhangOffsetSD_X = "72"
theme.OverhangOffsetSD_Y = "31"
theme.OverhangSliceSD = "pkg:/images/Overhang_Background_SD.png"
theme.OverhangLogoSD = "pkg:/images/Overhang_Logo_SD.png"
theme.OverhangOffsetHD_X = "125"
theme.OverhangOffsetHD_Y = "35"
theme.OverhangSliceHD = "pkg:/images/Overhang_Background_HD.png"
theme.OverhangLogoHD = "pkg:/images/Overhang_Logo_HD.png"
theme.BackgroundColor = "#FFFFFF"
app.SetTheme(theme)
End Sub
Any help would be appreciated! Thanks! 😄