-
-
Save zoharbabin/0487fd21f4822c3a7fac31130e980811 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
//reset these with every player load/playback session | |
var PLAY_REACHED_25_PERCENT = false; | |
var PLAY_REACHED_50_PERCENT = false; | |
var PLAY_REACHED_75_PERCENT = false; | |
var PLAY_REACHED_100_PERCENT = false; | |
kalturaPlayer.addEventListener(kalturaPlayer.Event.Core.TIME_UPDATE, function (event) { | |
var progpercent = kalturaPlayer.currentTime / kalturaPlayer.duration; | |
if (!PLAY_REACHED_25_PERCENT && progpercent >= 0.25) { | |
PLAY_REACHED_25_PERCENT = true; | |
console.log("25%"); | |
} | |
if (!PLAY_REACHED_50_PERCENT && progpercent >= 0.5) { | |
PLAY_REACHED_50_PERCENT = true; | |
console.log("50%"); | |
} | |
if (!PLAY_REACHED_75_PERCENT && progpercent >= 0.75) { | |
PLAY_REACHED_75_PERCENT = true; | |
console.log("75%"); | |
} | |
if (!PLAY_REACHED_100_PERCENT && progpercent === 1) { | |
PLAY_REACHED_100_PERCENT = true; | |
console.log("100%"); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment