Created
June 26, 2014 18:44
-
-
Save jramsahai/1f0be24672c0b0da558d to your computer and use it in GitHub Desktop.
Pausing the player after each chapter allows you to take some kind of alternate action with the viewer in the middle of the player. Use the opportunity to hit them with a CTA of some kind (additional info, form, etc.) then start them right back on the video from where they left off. I used the player API and a new play event.
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
<html> | |
<head> | |
<script src="//play.vidyard.com/v0/api.js"></script> | |
</head> | |
<body> | |
<script type="text/javascript" id="vidyard_embed_code_hsEU_eBjTeQ1Wk1NxIF99w" src="//play.vidyard.com/hsEU_eBjTeQ1Wk1NxIF99w.js?v=3.1&type=inline"></script> | |
<script type="text/javascript"> | |
var video = new Vidyard.player("hsEU_eBjTeQ1Wk1NxIF99w"); | |
var paused = 0; | |
video.on("play", function() { | |
if (paused==1) { | |
video.pause(); | |
} | |
paused = 0; | |
}); | |
video.on("chapterComplete", function() { | |
paused = 1; | |
}); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment