jan-h
9/27/2013 - 8:21 AM

Use the endstate event on a SDL Media Manager Player. See this working on http://jsfiddle.net/Jhorsman/NtQrN/

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>