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

issue since 4.8 update

Ive had an issue with my splash screen code not functioning since the 4.8 update. It works on Roku 1s but not 2s. On Roku 2s the screen flashes and then closes out of the application. This used to work fine. Thanks in advance.



Sub RunUserInterface()
deviceInfo = CreateObject( "roDeviceInfo" )
displaySize = deviceInfo.GetDisplaySize()
if displaySize.w = 1280 then
background = {
Color: "#FFFFFF"
}
loadingImage = {
Url: "pkg:/images/indie_hd.png"
TargetRect: {
w: 1280, h: 720
}
}
canvas = CreateObject( "roImageCanvas" )
canvas.SetLayer( 0, [ background, loadingImage ] )
canvas.Show()

Sleep(6500)
else if displaySize.w = 720 then
background = {
Color: "#FFFFFF"
}
loadingImage = {
Url: "pkg:/images/indie_sd.png"
TargetRect: {
w: 720, h: 480
}
}
canvas = CreateObject( "roImageCanvas" )
canvas.SetLayer( 0, [ background, loadingImage ] )
canvas.Show()

Sleep(6500)
end if

'display a fake screen while the real one initializes. this screen
'has to live for the duration of the whole app to prevent flashing
'back to the roku home screen.
screenFacade = CreateObject("roPosterScreen")
screenFacade.show()

Main()

screenFacade.showMessage("")


End Sub

0 Kudos
2 REPLIES 2
TheEndless
Channel Surfer

Re: issue since 4.8 update

Are there any error messages logged to the debug console?

It looks like you're calling a Main() function from inside the RunUserInterface() function. I think those two function names are mutually exclusive as entry points. It's possible that 4.8 has become more strict about that...?

Otherwise, it might be a scoping issue. I haven't tested it specifically, but it's possible that 4.8 limited scope in Brightscript like more traditional languages. Since you're declaring and setting the canvas object inside the if...then block, it may be going out of scope when you leave that block, before it's able to create the facade to keep the channel alive. Try declaring the canvas variable outside of the if...then block:
canvas = invalid
if displaySize.w = 1280 then
canvas = CreateObject("roImageCanvas")
.
.
.
end if

Alternatively, you could use manifest based splash screen... http://blog.roku.com/developer/2012/02/ ... h-screens/
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
uarlive
Visitor

Re: issue since 4.8 update

thanks. i will work on it tonight.
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.