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: 

Using imagecanvas on video screen but controls disappeared?

Hey
I am trying to implement image canvas on video screen.Every things works fine expect that the controls of video screen are not visible.Help me with this issue.


Sub main()

port = CreateObject("roMessagePort")
screen = CreateObject("roVideoScreen")

episode=CreateObject("roAssociativeArray")
episode.HDBranded = false
episode.IsHD = false


episode.Stream = { url:"http://download.wavetlan.com/SVV/Media/HTTP/H264/Other_Media/H264_test5_voice_mp4_480x360.mp4",
bitrate:2000
quality:false
contentid:"mycontent-2000"
}
episode.StreamFormat= "mp4"
canvasItems = [

{
Text:"The Server will go down"
TextAttrs:{Color:"#0000000", Font:"Medium",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:390,y:357,w:500,h:60}
}
]
canvasItems1 = [

{
Text:"Hello ImageCanvas"
TextAttrs:{Color:"#0000000", Font:"Medium",
HAlign:"HCenter", VAlign:"VCenter",
Direction:"LeftToRight"}
TargetRect:{x:390,y:357,w:500,h:60}
}
]

canvas = CreateObject("roImageCanvas")
'port = CreateObject("roMessagePort")
canvas.SetMessagePort(port)
'Set opaque background
' canvas.SetLayer(0, {Color:"#FF000000", CompositionMode:"Source"})
'canvas.SetRequireAllImagesToDraw(true)


screen.SetContent(episode)
screen.SetMessagePort(port)
screen.Show()
' ' canvas.SetLayer(0, { Color: "#80000000", CompositionMode: "Source" })
canvas.SetLayer(0, canvasItems)
canvas.Show()


while true
msg = wait(0, port)
index = msg.GetIndex()
if type(msg) = "roVideoScreenEvent" then
print "showVideoScreen | Playback position = "; msg.isPlaybackPosition() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
else if msg.isStatusMessage()
print "status message: "; msg.GetMessage()
else if msg.isPlaybackPosition()
print "playback position: "; msg.GetIndex()


else if msg.isStreamSegmentInfo()
print "playback info"
print msg.GetMessage()
exit while
else if msg.isPartialResult()
print "playback interrupted"
exit while
else if msg.isRequestFailed()
print "request failed – error: "; msg.GetIndex();" – "; msg.GetMessage()
exit while

end if
end if
end while




End Sub



0 Kudos
3 REPLIES 3
NewManLiving
Visitor

Re: Using imagecanvas on video screen but controls disappear

The imagecanvas is layered. If you want something on top generally you would put it at a higher layer. Layer 0 is generally for background, < 0 is to hide layers and >0 for items that ride over everything else. So instead of putting everything in layer 0 define what goes where and then setlayer accordingly
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
TheEndless
Channel Surfer

Re: Using imagecanvas on video screen but controls disappear

You can't use roImageCanvas with roVideoScreen. You need to use it with roVideoPlayer, and you'll need to implement all of the video controls yourself. Unfortunately, there is no way to customize the video player without implementing all functionality in code.
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
NewManLiving
Visitor

Re: Using imagecanvas on video screen but controls disappear

Thanks TheEndless did not pick up that he was using rovideoscreen
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
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.