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

imagecanvas problem in splashscreen

Hi,
I have a splash video to be played after the channel loads.But when the loading is over ,a black screen appears for a while and then it starts playing splash video.Same is the case when using splash image also.How can i remove that black screen , so that after the channel loading , i can directly see the video?


Sub Main()
ShowSplash()
End Sub

Function ShowSplash() As integer
port = CreateObject("roMessagePort")
canvas = CreateObject("roImageCanvas")
player = CreateObject("roVideoPlayer")
canvas.SetMessagePort(port)
player.SetMessagePort(port)
canvas.SetLayer(0, { color: "#00000000", CompositionMode: "Source" })
player.SetPositionNotificationPeriod(1)
player.SetContentList([{
streamFormat: "mp4"
stream: { url: "http://clips.vorwaerts-gmbh.de/VfE_html5.mp4" }
}])
player.SetDestinationRect(canvas.GetCanvasRect())
canvas.Show()
player.Play()
while true
msg = Wait(0, port)
'print type(msg)
if msg.isStreamStarted()
print player.GetPlaybackDuration()
print msg.GetIndex()
else if msg.isFullResult()
'showRegOptions()
player.Stop()
doRegistration()
else if msg.isScreenClosed() then
return -1
end if
end while
return 0
End Function
0 Kudos
2 REPLIES 2
RokuJoel
Binge Watcher

Re: imagecanvas problem in splashscreen

First, display the splash screen image on a layer of your image canvas. Then listen for msg.IsStatusMessage() If msg.GetMessage()="stream started" then clear the layer to transparent.

- Joel
0 Kudos
salman23
Visitor

Re: imagecanvas problem in splashscreen

"RokuJoel" wrote:
First, display the splash screen image on a layer of your image canvas. Then listen for msg.IsStatusMessage() If msg.GetMessage()="stream started" then clear the layer to transparent.

- Joel


Thanks for your quick reply @RokuJoel.But i have two doubts remaining.It would be great ,if you have considered this too.
1.Isn't it enough to clear the layer to transparent in msg.IsStreamstarted() message itself?

2.How can we make the layer transparent.Is it by using ClearLayer() or SetLayer().Do i need to use screen.Show() after that to update the screen?
0 Kudos