Last active
June 23, 2016 03:50
-
-
Save jramsahai/65bd7599c9403a15fb56 to your computer and use it in GitHub Desktop.
The Vidyard Progress Events Framework will allow you to execute arbitrary javascript at fixed intervals during the playback of the video. This basic example will write view data to the browser console.
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
<!-- | |
Include this script below: Google Analytics, Player Embed(s), and Vidyard API | |
Example Customer Implementations: | |
VidyardProgressEvents(function (result){console.log(result.event)}); | |
VidyardProgressEvents(function (result){console.log(result.event)}, [1,10,20,30,40,50,60,70,80,90]); | |
// Returns: | |
// result.event as integer | |
// result.chapter as integer | |
// result.player as a Vidyard player object | |
--> | |
<html> | |
<head> | |
</head> | |
<body> | |
<script type='text/javascript' id='vidyard_embed_code_HFgE1I16PiLBqKUNqHz73A' src='//play.vidyard.com/HFgE1I16PiLBqKUNqHz73A.js?v=3.1.1&type=inline'></script> | |
<script type='text/javascript' src="//play.vidyard.com/v0/api.js"></script> | |
<script type='text/javascript' src="//play.vidyard.com/v1/progress-events.js"></script> | |
<script type='text/javascript'> | |
var c = new Vidyard.player(""); | |
VidyardProgressEvents(function (result){ | |
console.log(`${result.player.metadata.chapters_attributes[result.chapter].video_attributes.name}: ${result.event}%.`); | |
}, [1,25,50,75,100]); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment