Last active
August 29, 2015 14:01
-
-
Save jramsahai/27108885d81c1bd6b4b2 to your computer and use it in GitHub Desktop.
Sometimes you might want to create a play button for the Vidyard player outside of the player itself. Here's one way to do it using a hyperlink with the player API.
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="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<script src="//play.vidyard.com/v0/api.js"></script> | |
</head> | |
<body> | |
<a href="" id="playvideo">Play video</a><br /><br /> | |
<script type="text/javascript" id="vidyard_embed_code_VTYj3v6rf7JsXhwYhJRZ4A" src="//play.vidyard.com/VTYj3v6rf7JsXhwYhJRZ4A.js?v=3.1&type=inline"></script> | |
<script type="text/javascript"> | |
var a = document.getElementById("playvideo"); | |
var video = new Vidyard.player("VTYj3v6rf7JsXhwYhJRZ4A"); | |
a.onclick = function() { | |
video.play(); | |
return false; | |
} | |
video.on("playerComplete", function() { window.alert("Video complete!"); }); | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment