Skip to content

Instantly share code, notes, and snippets.

@MeoMix
Created July 21, 2015 01:36
Show Gist options
  • Save MeoMix/3283dea94a4be6ca9b43 to your computer and use it in GitHub Desktop.
Save MeoMix/3283dea94a4be6ca9b43 to your computer and use it in GitHub Desktop.
// Send a message to YouTube's iframe to figure out what the current time is of the video element inside of the iframe.
requestCurrentTimeHighPrecision: function() {
var iframePort = this.get('iframePort');
iframePort.postMessage('getCurrentTimeHighPrecision');
}
_onYouTubeIFrameMessage: function(message) {
if (!_.isUndefined(message.currentTimeHighPrecision)) {
this.trigger('receive:currentTimeHighPrecision', this, message);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment