timer, time and media.playVideo

Hi,

I’m having problems with timing when my video finishes playing. I’m using media.playVideo to play my intro animation. I’m listening to completion event. In this on complete function handler I’m calling timer.performWithDelay to start my code. Unfortunately the timers are not working correctly after the video has been played. Please, can someone explain to me the system timer behaviour behind this?

Thx a lot [import]uid: 38630 topic_id: 10655 reply_id: 310655[/import]

I’m having a similar problem. When my video finishes, I want it to play an audio and that’s not working. [import]uid: 8780 topic_id: 10655 reply_id: 38801[/import]

I think I have found a solution. It seems there is some inconsistency in system timers when the video finishes so I did the following:

[lua]local lastTime = 0;

function enterFrame(event)
local now = system.getTimer();
local deltaTime = now - lastTime;
lastTime = now;

if (deltaTime > 0) then
Runtime:removeEventListener(“enterFrame”, enterFrame);
– *** ALL OK NOW - you can continue *** –
end
end

– videos on complete event
function onComplete()
lastTime = system.getTimer();
Runtime:addEventListener(“enterFrame”, enterFrame);
end[/lua] [import]uid: 38630 topic_id: 10655 reply_id: 38835[/import]