Your Digital Media Has Never Looked So Good

Topic Author
Posts: 21
Joined: Fri May 23, 2014 7:47 am

roScreen and roVideoPlayer help

Sat Jun 07, 2014 1:58 pm

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
User avatar
Posts: 452
Joined: Fri Aug 02, 2013 6:14 pm

Re: roScreen and roVideoPlayer help

Sat Jun 07, 2014 3:57 pm

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 )
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: roScreen and roVideoPlayer help

Wed Jun 11, 2014 1:00 pm

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?

Who is online

Users browsing this forum: No registered users and 4 guests