--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Popcorn 0.1 parser Plug-in Test</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.parseXML.js"></script>
+ <script src="popcorn.parseXML.unit.js"></script>
+</head>
+<body>
+ <h1 id="qunit-header">Popcorn 0.1 parser Plug-in Test</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
+ 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"'>
+
+ <p>Your user agent does not support the HTML5 Video element.</p>
+
+ </video>
+ <div id="footnotediv"></div>
+</body>
+</html>
--- /dev/null
+test("Popcorn 0.1 XML Parser Plugin", function () {
+
+ var expects = 7,
+ count = 0,
+ timeOut = 0,
+ interval,
+ poppercorn = Popcorn( "#video" );
+
+ function plus() {
+ if ( ++count === expects ) {
+ start();
+ // clean up added events after tests
+ clearInterval( interval );
+ }
+ }
+
+ expect(expects);
+
+ stop( 10000 );
+
+ Popcorn.plugin("parserTest1", {
+
+ start: function ( event, options ) {
+ ok( options.item2 === "item2", "parserTest1 has data directly from manifest" );
+ plus();
+ ok( options.item3 === "item3", "parserTest1 has cascading data from manifest" );
+ plus();
+ },
+ end: function ( event, options ) {}
+ });
+
+ Popcorn.plugin("parserTest2", {
+
+ start: function ( event, options ) {
+ ok( options.text === "item4", "parserTest2 has text data" );
+ plus();
+ ok( options.item1 === "item1", "parserTest2 has cascading data from parent" );
+ plus();
+ },
+ end: function ( event, options ) {}
+ });
+
+ Popcorn.plugin("parserTest3", {
+
+ start: function ( event, options ) {
+ ok( options.item1 === "item1", "parserTest3 has cascading data from parent" );
+ plus();
+ ok( options.item2 === "item2", "parserTest3 has data directly from manifest" );
+ plus();
+ ok( options.item3 === "item3", "parserTest3 has cascading data from manifest" );
+ plus();
+ },
+ end: function ( event, options ) {}
+ });
+
+ poppercorn.parseXML("unit.XML");
+
+ // interval used to wait for data to be parsed
+ interval = setInterval( function() {
+ poppercorn.currentTime(5).play().currentTime(6);
+ }, 2000);
+
+});
--- /dev/null
+<popcorn>
+
+ <manifest>
+
+ <container item3="item3">
+ <somedata id="somedata" item2="item2"/>
+ </container>
+
+ </manifest>
+
+ <timeline>
+ <parserTest1 in="5" out="6" resourceid="somedata"/>
+
+ <container item1="item1">
+ <parserTest2 in="5" out="6">item4</parserTest2>
+ <parserTest3 in="5" out="6" resourceid="somedata"/>
+ </container>
+
+ </timeline>
+
+</popcorn>