Last active
December 24, 2015 01:39
-
-
Save jhorsman/6725595 to your computer and use it in GitHub Desktop.
Use the endstate event on a SDL Media Manager Player. See this working on http://jsfiddle.net/Jhorsman/NtQrN/
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
<!DOCTYPE html> | |
<!-- | |
Using | |
- HTML5 video player | |
- show-layer-endstate event | |
Example on http://jsfiddle.net/Jhorsman/NtQrN/ | |
--> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<script> | |
$(document).bind("MMPLAYERREADY", function() { | |
console.log("MMPLAYERREADY event fired"); | |
$("#myPlayer").bind("show-layer-endstate", function() { | |
console.log("show-layer-endstate event fired"); | |
alert("Let us play again!"); | |
$("#myPlayer").children().last().trigger("play") | |
}); | |
}); | |
</script> | |
<style type="text/css"> | |
.player { | |
background-color: #C0C0C0; | |
width: 600px; | |
height: 338px | |
} | |
</style> | |
</head> | |
<body> | |
<div id="myPlayer" class="player"> | |
<script type="text/javascript" language="javascript" src="http://sdl-training.dist.sdlmedia.com/vms/distribution/embed/?o=2981B015-A171-4C6A-BEC6-9C0BC80B9F4E"></script> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment