johndyer/mediaelement — pull request #365 by dkozma (2012-01-20 19:29:55+00:00)
Title: Fix for Issue #324 (Handle runs away while seeking during playback)

John,

I wanted to provide a fix for Issue #324 (https://github.com/johndyer/mediaelement/issues/324) which deals with the time handle running away while seeking during playback.

The fix basically adds an isSeeking variable to each player, and if the user drags the handle during playback, pauses the movie until the seek is completed. I altered some of the media pause event callbacks so that the bigPlay icon and play button are not displayed when the user is actively seeking through the movie. I added some logic to the document's mouseup handler you created to set isSeeking to false and resume playback - it seemed like a good place since the document/body would be the only thing that could reliably call the mouseup event if you released the mouse button outside of the handle (which is probably why you added that callback).

The last commit in here effectively removes the waiting overlay since it seemed pretty distracting in Firefox when seeking through the movie. You can decide whether you would like to include or exclude that last commit if you decide to integrate this pull request.

This has been tested in recent versions of Chrome, Firefox, Safari, and Opera. Please let me know if you have any questions or concerns. Thank you for all of your great work on this project, it is really appreciated.

Thanks,
Dave Kozma