destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-06-2013
01:25 PM
Splashscreen with Roku1?
From RokuJoel --
Place that in your main function, or the first one your channel runs.
di=createobject("roDeviceInfo")
canvas=CreateObject("roImageCanvas")
canvas.SetLayer(0, { color: "#000000" })
If di.GetDisplayType()="HDTV"
canvas.SetLayer(1, [{
url: "pkg:/images/splashhd.jpg"
targetRect: {
x: 0
y: 0
w: 1280
h: 720
}
}])
Else
canvas.SetLayer(1, [{
url: "pkg:/images/splashsd.jpg"
targetRect: {
x: 0
y: 0
w: 720
h: 480
}
}])
End If
canvas.Show()
Place that in your main function, or the first one your channel runs.
6 REPLIES 6

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013
10:31 AM
Re: Splashscreen with Roku1?
"destruk" wrote:
From RokuJoel --
code copied by RokuJoel, created by RokuChris 🙂
- Joel
destruk
Streaming Star
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-07-2013
02:18 PM
Re: Splashscreen with Roku1?
Thanks RokuChris and RokuJoel ! 🙂
greubel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013
02:33 PM
Re: Splashscreen with Roku1?
How do you detect that you need to display it ?
Roku level 3 or less than 4 ?
Roku level 3 or less than 4 ?

RokuJoel
Binge Watcher
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013
03:31 PM
Re: Splashscreen with Roku1?
Best bet would be to use it on all platforms, no need to detect. If you must detect version, use rodeviceinfo:
- Joel
function IsNotLegacyDevice() as boolean
version = CreateObject("roDeviceInfo").GetVersion()
major = Mid(version, 3, 1)
minor = Mid(version, 5, 2)
build = Mid(version, 8, 5)
if major.toint() >= 4 then
return true
else
return false
end if
end function
- Joel
greubel
Visitor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013
06:51 PM
Re: Splashscreen with Roku1?
I must have missed something ????
I created a subroutine called from the main with a combination of the above snippets, displayed the splash screen with a 1 sec wait. Looked good.
Then returned and the program closed ???? ( screen fell off the stack )
Now the funny thing is, it didn't close right away. Got through several subroutines before it died. And appears to die in different spots.
Changed the subroutine to return the screen object and had the main caller keep an instance. Now it works !!!
Changed the subroutine to close() the screen object and it fails !
Where is it written that if you display a screen, close it and it was the only one, that it implies "PROGRAM END" ????
Maybe the program had something else to do ! In this case, the entire program.
Now to have this work, I have to keep the splash screen object laying around.
I created a subroutine called from the main with a combination of the above snippets, displayed the splash screen with a 1 sec wait. Looked good.
Then returned and the program closed ???? ( screen fell off the stack )
Now the funny thing is, it didn't close right away. Got through several subroutines before it died. And appears to die in different spots.
Changed the subroutine to return the screen object and had the main caller keep an instance. Now it works !!!
Changed the subroutine to close() the screen object and it fails !
Where is it written that if you display a screen, close it and it was the only one, that it implies "PROGRAM END" ????
Maybe the program had something else to do ! In this case, the entire program.
Now to have this work, I have to keep the splash screen object laying around.


Roku Employee
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2013
06:57 PM
Re: Splashscreen with Roku1?
It has always been true that a channel exits when you close all of its screens and there has been a fair bit of discussion about it here over the years.
viewtopic.php?f=34&t=50590&start=0
http://sdkdocs.roku.com/display/sdkdoc/ ... th+Screens
http://sdkdocs.roku.com/display/sdkdoc/ ... kuPlatform
viewtopic.php?f=34&t=50590&start=0
http://sdkdocs.roku.com/display/sdkdoc/ ... th+Screens
http://sdkdocs.roku.com/display/sdkdoc/ ... kuPlatform