Skip to content

Instantly share code, notes, and snippets.

@larsmqller
Created September 6, 2018 23:06
Show Gist options
  • Save larsmqller/363891d2285a4b37dad80e73a2e7c616 to your computer and use it in GitHub Desktop.
Save larsmqller/363891d2285a4b37dad80e73a2e7c616 to your computer and use it in GitHub Desktop.
init: function () {
console.log('#asdf');
var self = this;
$("video[data-ga-logging-name]").on("play", function () {
var gaLoggingName = this.dataset.gaLoggingName;
fl.videoLog.vars.trackingStatus = true;
self.logPlayStartToGa(gaLoggingName);
self.setMarkers();
fl.videoLog.vars.currentVideo = this;
function trackProgress () {
fl.videoLog.vars.currentEventLabel = gaLoggingName;
self.videoProgressTracking();
}
// So i would do this?
if (typeof this.duration === 'number' && this.duration > 0) {
trackProgress();
} else {
$(this).one('durationchange', trackProgress);
}
// End
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment