Splashscreen with Roku1?

From RokuJoel –


	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.

“destruk” wrote:
From RokuJoel –

code copied by RokuJoel, created by RokuChris :slightly_smiling_face:

  • Joel

Thanks RokuChris and RokuJoel ! :slightly_smiling_face:

Best bet would be to use it on all platforms, no need to detect. If you must detect version, use rodeviceinfo:

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

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