I am working on a custom windowed video player. The functionality that I want is to show a now loading image on top of (or instead of) video player when player is buffering the video and remove the now loading image when player starts to play the video.
But the problem is once now loading image is drawn on the screen it is not going away when player starts to play the video.
Here is the code that I am using to draw the canvas:
function draw_canvas()
m.canvas.AllowUpdates(false)
m.canvas.Clear()
m.canvas.SetLayer(0, m.canvasLayers.background)
if m.isLoadingVideo = true
m.canvas.SetLayer(1, [m.canvasLayers.frameImage, m.canvasLayers.nowLoadingImage])
else if m.isLoadingVideo = false
m.canvas.SetLayer(1, [m.canvasLayers.frameImage])
end if
m.canvas.AllowUpdates(true)
end function
Here is the code that calls this draw_canvas function in the event loop:
if type(msg) = "roVideoPlayerEvent"
if msg.GetMessage() = "start of play"
m.isLoadingVideo = false
m.drawCanvas()
else if msg.GetMessage() = "startup progress"
if m.isLoadingVideo <> true
m.isLoadingVideo = true
m.drawCanvas()
end if
end if
end if
roVideoPlayer starts to work with the start of application and is located at the same coordinates as now loading image.
And here is code from my controller function:
m.drawCanvas()
m.videoPlayer.Play()
return m.eventLoop()
I am not able to locate where the problem is so if anyone can help me with it please???