Created
October 31, 2013 12:27
-
-
Save jhorsman/7248847 to your computer and use it in GitHub Desktop.
Play and pause a Media Manager player
This file contains hidden or 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 | |
- play event | |
- pause event | |
Try this script on http://jsfiddle.net/3MjZu/1/ | |
--> | |
<html> | |
<head> | |
<script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> | |
<script> | |
$(document).ready(function() { | |
$("#play").bind("click", function() { | |
$("#myPlayer").find(">:last-child").trigger("play") | |
console.log("play button click"); | |
}) | |
$("#pause").bind("click", function() { | |
$("#myPlayer").find(">:last-child").trigger("pause") | |
console.log("pause button click"); | |
}) | |
}); | |
</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> | |
<button id="play">Play</button> | |
<button id="pause">Pause</button> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment