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: 
evilmax17
Visitor

Channel "Loading" screen - as seen in PodTV and KoldcastTV

I just tried both PodTV and KoldcastTV for the first time, and they both shared something that I haven't seen in other channels.

When you first launch the channel, you are greeted with a minimalistic loading screen. It has a solid-black background, and prominently displays the channel logo with the "loading..." written underneath it.

Is this a new feature in the 2.8 SDK? If not, are there best-practices that Roku wants to encourage when implementing something like this?
My Roku Channels:
Viddler - viddler.com
Tested Fan - tested.com | Jamie & Adam
This is my next - theverge.com
1080p Showcase - RIP
Whiskey Media - RIP
======================
http://www.binarymoustache.com
0 Kudos
17 REPLIES 17
TheEndless
Channel Surfer

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

Not a new feature.. just an roImageCanvas, if I'm not mistaken. My MainSqueeze channel implemented something similar back in 2.6.
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
TheEndless
Channel Surfer

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

I'm not sure how RokuChris does it (I believe he's the developer of both of the channels that you mentioned), but if you're interested, here's a simplified version of my implementation that uses the HD channel icon... I put this in my RunUserInterface() method instead of the facade screen...

deviceInfo = CreateObject( "roDeviceInfo" )
displaySize = deviceInfo.GetDisplaySize()
background = {
Color: "#000000"
}
loadingImage = {
Url: "pkg:/images/mm_icon_focus_hd.png"
TargetRect: {
x: Int( displaySize.w / 2 ) - Int( 336 / 2 ),
y: Int( displaySize.h / 2 ) - Int( 209 / 2 ),
w: 336,
h: 209
}
}
loadingText = {
Text: "Loading...",
TextAttrs: {
Font: "Large",
VAlign: "Top"
},
TargetRect: {
x: loadingImage.TargetRect.x,
y: loadingImage.TargetRect.y + 25,
w: loadingImage.TargetRect.w,
h: 30
}
}
canvas = CreateObject( "roImageCanvas" )
canvas.SetLayer( 0, [ background, loadingImage, loadingText ] )
canvas.Show()
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
dynamitemedia
Binge Watcher

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

i thought i would give this a try and im getting the following error

006: Sub RunUserInterface()
007:
008: deviceInfo = CreateObject( "roDeviceInfo" )
009: displaySize = deviceInfo.GetDisplaySize()
010: background = {
011: Color: "#000000"
012: }
013: loadingImage = {
014: Url: "pkg:/images/MainMenu_Icon_CenterFocus_HD.png"
015: TargetRect: {
016: x: Int( displaySize.w / 2 ) - Int( 336 / 2 ),
017: y: Int( displaySize.h / 2 ) - Int( 209 / 2 ),
018: w: 336,
019: h: 209
020: }
021: }
022: loadingText = {
023: Text: "Loading...",
024: TextAttrs: {
025: Font: "Large",
026: VAlign: "Top"
027: },
028: TargetRect: {
029: x: loading.TargetRect.x,
030: y: loading.TargetRect.y + 25,
031: w: loading.TargetRect.w,
032: h: 30
033: }
034: }
035: canvas = CreateObject( "roImageCanvas" )
036: canvas.SetLayer( 0, [ background, loadingImage, loadingText ] )
037: canvas.Show()
038:
039: showWelcomeScreen()
040: homeMain()
041:
042:
043: End Sub
/tmp/plugin/NEAAAAa9pBYR/pkg:/source/appMain.brs(29): runtime error ec: 'Dot' Op
erator attempted with invalid BrightScript Component or interface reference.

029: x: loading.TargetRect.x,

Backtrace:
Function runuserinterface() As Void

i added these cause i wasnt sure if i need them as they are in my sub main()
039: showWelcomeScreen()
040: homeMain()

I also took out the sub main(), do i need to?
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
TheEndless
Channel Surfer

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

Sorry, "loading" on lines 29-31 should be "loadingImage". That's what I get for making a last minute change to the code without testing. I've updated my original code snippet.
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
dynamitemedia
Binge Watcher

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

thanks endless now i have two questions about this screen.

1.) is there a way to set a time on it?

2.) I do not want it showing twice, its also showing after i click the start button on the welcome screen. i tried doing a canvas.close but it didnt like that. it just exited the channel

the way i have it now is

Sub RunUserInterface()
deviceInfo = CreateObject( "roDeviceInfo" )
displaySize = deviceInfo.GetDisplaySize()
background = {
Color: "#000000"
}
loadingImage = {
Url: "pkg:/images/MainMenu_Icon_CenterFocus_HD.png"
TargetRect: {
x: Int( displaySize.w / 2 ) - Int( 336 / 2 ),
y: Int( displaySize.h / 2 ) - Int( 209 / 2 ),
w: 336,
h: 209
}
}
loadingText = {
Text: "Loading...",
TextAttrs: {
Font: "Large",
VAlign: "Top"
},
TargetRect: {
x: loading.TargetRect.x,
y: loading.TargetRect.y + 25,
w: loading.TargetRect.w,
h: 30
}
}
canvas = CreateObject( "roImageCanvas" )
canvas.SetLayer( 0, [ background, loadingImage, loadingText ] )
canvas.Show()

initTheme()
showWelcomeScreen()
homeMain()
End Sub


but its going in this order
1.) RunUserInterface()
2.) showWelcomeScreen()
3.) RunUserInterface()
4.) homeMain()

i dont want that i just want it going like this
1.) RunUserInterface()
2.) showWelcomeScreen()
3.) homeMain()
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
TheEndless
Channel Surfer

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

No idea why RunUserInterface would be getting called twice, unless you're explicitly calling it in your code somewhere... ?
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
dynamitemedia
Binge Watcher

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

i had to take it out for now... however i did like it...

i must have it called somewhere or maybe its cause its not closing out the screen or something...

Is it possible to set a timer on hit however?
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuKevin
Visitor

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

You should add a screen facade to assure there's always a screen in the display stack whenever your channel is executing.

Add it to your RunUserInterface() method like so:


'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()

showWelcomeScreen()
homeMain()

'exit the app gently so that the screen doesn't flash to black
screenFacade.showMessage("")
sleep(25)


--Kevin
0 Kudos
dynamitemedia
Binge Watcher

Re: Channel "Loading" screen - as seen in PodTV and Koldcast

unless i am missing something or did something wrong here. this code below skips past everything and goes straight to the welcome screen


Sub RunUserInterface()
deviceInfo = CreateObject( "roDeviceInfo" )
displaySize = deviceInfo.GetDisplaySize()
background = {
Color: "#000000"
}
loadingImage = {
Url: "pkg:/images/Logo.png"
TargetRect: {
x: Int( displaySize.w / 2 ) - Int( 336 / 2 ),
y: Int( displaySize.h / 2 ) - Int( 209 / 2 ),
w: 365,
h: 110
}
}
loadingText = {
Text: "Loading...",
TextAttrs: {
Font: "Large",
VAlign: "Bottom"
},
TargetRect: {
x: loadingImage.TargetRect.x,
y: loadingImage.TargetRect.y + 225,
w: loadingImage.TargetRect.w,
h: 30
}
}
canvas = CreateObject( "roImageCanvas" )
canvas.SetLayer( 0, [ background, loadingImage, loadingText ] )
canvas.Show()

initTheme()
screenFacade = CreateObject("roPosterScreen")
screenFacade.show()

showWelcomeScreen()
homeMain()

screenFacade.showMessage("")
sleep(25)

End Sub
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
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.