Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Level 7

roScreen and roVideoPlayer help

I am trying to understanding how to get roScreen and rovideoPlayer work . I manage to get a video played however, its not displaying in the screen. i can hear the audio but not video. it appears its running on the background.

Could someone please help me how to get the video displayed! . Thanks a bunch.

I am calling this function from roSpringboardScreen screen when "play button is pressed"

Function screentest()

p = CreateObject("roMessagePort")
screen=createobject("roscreen",true,1280, 720)



screen.clear(&h000000FF) 'clear screen to black
targetrect = { x: 300, y: 300, w: 320, h: 180 }

player= CreateObject("roVideoPlayer")
'player.SetDestinationRect({x:0, y:0, w:0, h:0})
Stream: { url: "" }
StreamFormat: "mp4"
SwitchingStrategy: "full-adaptation"


' fontReg = CreateObject("roFontRegistry")
' font = fontReg.GetDefaultFont()
' screen.DrawText("Hello world....", 100, 100, &hFF00FF00, font)
' screen.Finish()
while true
'msg = wait(0, canvas.GetMessagePort())
'print "msg.....";msg
if type(msg) = "roVideoPlayerEvent"
if msg.isFullResult()
exit while
else if msg.isPartialResult()
exit while
else if msg.isRequestFailed()
print "isRequestFailed"
exit while
else if msg.isStatusMessage()
if msg.GetMessage() = "start of play"
print ""start of play""

end if
else if msg.isPlaybackPosition()
print "isPlaybackPosition: " + msg.GetIndex().ToStr()

end if

end if
end while

End Function
0 Kudos
Level 8

Re: roScreen and roVideoPlayer help

Not well documented but you need to draw a transparent
Rectangle around the dimensions of your
Videoplayer. Called punching a hole or a portal
Yeah I know it know it sounds absurd
My Channels: 2D API Framework Presentation:
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
Level 11

Re: roScreen and roVideoPlayer help

"NewManLiving" wrote:
Not well documented but you need to draw a transparent Rectangle around the dimensions of your Videoplayer. Called punching a hole or a portal

Hm, yeah. I remember reading somewhere about the video and graphics planes - but alas i cannot find it in the RTFM. I find this in an earlier thread and seems to me so insightful, i'll quote it here for posterity:
"RokuMarkn" wrote:
The video plane is "below" (lower z-order) than the graphics plane. This is a feature of the hardware in all products. [...] The only reason it looks like it's in front of graphics is because it's showing through the transparent hole you've punched in the graphics plane.

An roScreen and everything that's drawn to it, either directly or via roCompositor, is drawn on the graphics plane. [...] In fact all screen types except the video player (with the complicated exception of roGridScreen) are drawn to the graphics plane. The only reason video is ever visible is when there is transparency in the graphics plane to reveal part or all of the video plane. This is why video display works the way it does.
RokuCo - include this in documentation?
0 Kudos