Created
October 26, 2014 22:32
-
-
Save Fauntleroy/014e94b74fd7d4d5d70c to your computer and use it in GitHub Desktop.
Poopy asyncSeek method, because <video> doesn't have one by default.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var asyncSeek = function( video, time, callback ){ | |
var doneSeeking = function(){ | |
video.removeEventListener( 'seeked', doneSeeking ); | |
if( callback ) callback(); | |
}; | |
video.addEventListener( 'seeked', doneSeeking ); | |
video.currentTime = time; | |
}; | |
module.exports = asyncSeek; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment