Hi,
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)
obj1={posx:0,posy:0}
screen.setalphaenable(false)
screen.SetMessagePort(p)
screen.clear(&h000000FF) 'clear screen to black
'screen.
targetrect = { x: 300, y: 300, w: 320, h: 180 }
player= CreateObject("roVideoPlayer")
player.SetMessagePort(p)
player.SetPositionNotificationPeriod(1)
player.SetDestinationRect(targetrect)
'player.SetDestinationRect({x:0, y:0, w:0, h:0})
player.SetContentList([{
Stream: { url: "http://video.ted.com/talks/podcast/CraigVenter_2008_480.mp4" }
StreamFormat: "mp4"
SwitchingStrategy: "full-adaptation"
}])
player.Play()
'screen.drawobject(obj1.posx,obj1.posy,player)
screen.SwapBuffers()
' fontReg = CreateObject("roFontRegistry")
' font = fontReg.GetDefaultFont()
' screen.DrawText("Hello world....", 100, 100, &hFF00FF00, font)
'screen.SwapBuffers()
' screen.Finish()
while true
'msg = wait(0, canvas.GetMessagePort())
msg=player.GetMessagePort().getmessage()
'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