PDA

View Full Version : Timer Lagging When Browser Window Loses Focus



GenericUserName
September 12th, 2009, 11:09 PM
So I have this SWF that is pulling videos from YouTube through their API. Everything is working nicely until I go to another browser tab or cause the window the SWF is in to lose focus otherwise (largely by using any program aside from the browser). When I return to the tab/window that the browser is playing in, if I have been away for anything over like 20 seconds, the time text that indicates where the play head is plays catchup jumping over 3-5 seconds at a time. While the video is not making these jumps, what is happening is that any buttons for controlling the video become unresponsive until the time text actually has caught up with the current position in the video play head. Thereafter all functioning for my other buttons (play/pause, full screen toggle, and sharing) returns to normal. I am using a Timer that calls every millisecond. I have altered this timer to call every second, but am still having this problem.

Any ideas?

Multifun
September 13th, 2009, 02:27 AM
Why does the time text catch up incrementally? Can you compare display time to actual time, and if the difference is more than 20 seconds, just jump the display to exactly the actual time rather than have it add incrementally?