Skip to content

Instantly share code, notes, and snippets.

@jhorsman
Last active December 24, 2015 01:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jhorsman/6725595 to your computer and use it in GitHub Desktop.
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/
<!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