Created
September 6, 2018 23:06
-
-
Save larsmqller/363891d2285a4b37dad80e73a2e7c616 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
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