screen = CreateObject("roScreen")
screen.SetMessagePort(port)
screen.screen.SetAlphaEnable(true)
screen.SwapBuffers()
bitmap=CreateObject("roBitmap", "pkg:/images/background.png")
screen.DrawObject(0,0, bitmap)
player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetDestinationRect({x:200, y:200, w:200, h:200})
player.SetContentList([{
streamFormat: "mp4"
stream: { url: "http://www.test.com/test.mp4" }
}])
player.Play()
screen.DrawObject(0, 0, player) ' not draw nothing
screen.SwapBuffers()
screen.finish()
"RokuMarkn" wrote:
Well, I see a few problems right off the bat. In line 6 you are using this.screen, but you never set that to anything (in the quoted code anyway). In the last line, you are attempting to draw an roVideoPlayer object to the screen, which doesn't make any sense. And even if you were drawing something sensible, there's no Finish or SwapBuffers call after that to finalize the drawing.
--Mark
"PTKDev" wrote:
How i draw roVideoPlayer over roScreen if this code is bad?
white=&hFFFFFFFF
font_registry = CreateObject("roFontRegistry")
font = font_registry.GetDefaultFont(10, false, false)
font16px = font_registry.GetDefaultFont(16, true, false)
player = CreateObject("roVideoPlayer")
player.SetMessagePort(port)
player.SetDestinationRect({x:54, y:128, w:450, h:350})
player.SetContentList([{
streamFormat: "mp4"
stream: { url: "http://techslides.com/demos/sample-videos/small.mp4" }
}])
player.Play()
'this have rect trasparent for show player
bitmap=CreateObject("roBitmap", "pkg:/images/test/bg_player.png")
screen.DrawObject(0, 124, bitmap)
bitmap=CreateObject("roBitmap", "pkg:/images/header.png")
screen.DrawObject(0,0, bitmap)
while true
if type(msg) = "roUniversalControlEvent" then
code = msg.GetInt()
if (code = 0) 'back
return -1
else if (code = 2) 'up
return -1
end if
end if
end while
while true
if type(msg) = "roUniversalControlEvent" then
code = msg.GetInt()
while true
msg = port.getmessage()
if type(msg) = "roUniversalControlEvent" then
code = msg.GetInt()
"squirreltown" wrote:while true
if type(msg) = "roUniversalControlEvent" then
code = msg.GetInt()
should bewhile true
msg = port.getmessage()
if type(msg) = "roUniversalControlEvent" then
code = msg.GetInt()
assuming you create a messageport somewhere called "port", it's not part of your snippet. You are drawing to screen and this.screen, maybe thats an issue.