-
-
Save shamansir/88d1eecaa6874cbc9920 to your computer and use it in GitHub Desktop.
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> | |
<!-- Animatron Player Bundle --> | |
<script type="text/javascript" src="http://player.animatron.com/latest/bundle/animatron.js"></script> | |
</head> | |
<body> | |
<!-- Canvas element for Player to draw into --> | |
<canvas id="anm"></canvas> | |
<!-- Custom controls --> | |
<div id="sections"> | |
<div class="section"> | |
Section 1. | |
<a href="javascript:play(0)">Play</a> | <!-- call play(0) to start playing from the beginning (0 sec) --> | |
<a href="javascript:pause();">Pause</a></div> <!-- pause control --> | |
<div class="section"> | |
Section 2. | |
<a href="javascript:play(10)">Play</a> | <!-- call play(10) to start playing from the beginning of second scene (10 secs) --> | |
<a href="javascript:pause();">Pause</a></div> <!-- pause control --> | |
</div> | |
<!-- Player initialization and project loading --> | |
<script type="text/javascript"> | |
var player; | |
// play function | |
function play(time) { | |
player.stop(); // ensure player is stopped | |
player.play(time); // start playing from the specified time | |
} | |
// pause player | |
function pause() { | |
player.pause(); | |
} | |
// initialize player and load project data | |
player = anm.Player.forSnapshot("anm", | |
/* Use your project ID from the Publish HTML dialog here. | |
(also, you may freely add URL parameters mentioned above to the end of this URL, | |
here we add width and height to resize player before loading the scene and | |
&m=0 to disable player's own controls) */ | |
"http://snapshots.animatron.com/8e188b4e170e60300117ce70fa76ab76-v1.1?w=700&h=200&m=0", | |
anm.createImporter('animatron'), | |
onLoad); | |
function onLoad() { | |
// add something you need to be run as soon as project will be loaded | |
// here, we show first frame of the animation | |
player.drawAt(0); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment