Created
July 21, 2015 01:36
-
-
Save MeoMix/1edd7fe1733cdd186b0a to your computer and use it in GitHub Desktop.
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
_setCurrentTime: function(playerState, currentTimeHighPrecision, timestamp) { | |
// If the player is playing then currentTimeHighPrecision will be slightly out-of-sync due to the time it takes to request | |
// the information. So, subtract an offset of the time it took to receive the message. | |
if (playerState === PlayerState.Playing) { | |
var offset = performance.now() - timestamp; | |
currentTimeHighPrecision -= offset * .001; | |
} | |
this.el.currentTime = currentTimeHighPrecision; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment