--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Popcorn API</title>
+ <link rel="stylesheet" href="../../test/qunit/qunit.css" type="text/css" media="screen">
+ <script src="../../test/qunit/qunit.js"></script>
+ <!--
+ do not move - this must be called immediately prior to
+ popcorn-api-draft.js
+ -->
+
+ <script src="../../popcorn.js"></script>
+ <script src="popcorn.mediafragment.js"></script>
+
+ <script src="popcorn.mediafragment.unit.js"></script>
+</head>
+<body>
+ <h1 id="qunit-header">Popcorn Mediafragment Plugin</h1>
+ <h2 id="qunit-banner"></h2>
+ <div id="qunit-testrunner-toolbar"></div>
+ <h2 id="qunit-userAgent"></h2>
+ <ol id="qunit-tests"></ol>
+ <div id="qunit-fixture"> </div>
+
+ <video id="video"
+ controls preload="none"
+ width="250px"
+ poster="../../test/poster.png">
+
+ <source id="mp4"
+ src="../../test/trailer.mp4"
+ type='video/mp4; codecs="avc1, mp4a"'>
+
+ <source id="ogv"
+ src="../../test/trailer.ogv"
+ type='video/ogg; codecs="theora, vorbis"'>
+
+ <source id='webm'
+ src="../../test/trailer.webm"
+ type='video/webm; codecs="vp8, vorbis"'>
+
+ <p>Your user agent does not support the HTML5 Video element.</p>
+
+ </video>
+ <div id="footnotediv"></div>
+ <div id="textdiv"></div>
+</body>
+</html>
--- /dev/null
+test( "Popcorn Footnote Plugin", function() {
+
+ var popped = Popcorn( "#video" ),
+ expects = 3,
+ count = 0;
+
+ expect( expects );
+
+ function plus() {
+ if ( ++count===expects ) {
+ start();
+ }
+ }
+
+ stop();
+
+ ok( "mediafragment" in popped, "mediafragment is a method of the popped instance" );
+ plus();
+
+ var currstate = window.location.href.split("#t=");
+ equals( currstate[1], undefined, "initially, there is no # in the url" );
+ plus();
+
+ popped.mediafragment({
+ start: 0,
+ });
+
+ popped.exec( 2, function() {
+ popped.pause();
+ popped.play();
+
+
+ });
+
+ popped.exec( 3, function() {
+ var currstate = window.location.href.split("#t=");
+ console.log(currstate);
+ var time = + currstate[1];
+
+ // popcorn's precision is limited to the second.
+ ok(time >= 2 && time <= 3, "correct time is set" );
+ plus();
+ popped.play();
+
+ });
+
+ popped.exec( 4, function() {
+ // clear the address bar
+ window.location.href = window.location.href.split("#t=")[0];
+ });
+
+ popped.play();
+});
\ No newline at end of file