]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Merge commit 'rick/t464' into 0.5
authorAnna Sobiepanek <annaopensource@gmail.com>
Wed, 20 Apr 2011 17:20:22 +0000 (13:20 -0400)
committerAnna Sobiepanek <annaopensource@gmail.com>
Wed, 20 Apr 2011 17:20:22 +0000 (13:20 -0400)
1  2 
test/popcorn.unit.js
test/ready.html

index 5d2e380a6c11c0ef71be2d1c1d3c796513b86dfc,97bcbebf9ee024a7f356745f3108225dd3cbffff..15a2f820ff76eb5336a775523603e39d6bb8d552
mode 100644,100755..100644
diff --cc test/ready.html
index 3b835a6d041b9bbafab3a8edd0ff4bd0a85757bb,5b4568615e6cbb9089bf81dfc6a1f7b622f1bf74..8bf78d18e4643cd703ba23dc45486d6a5c6154a6
- <!DOCTYPE html>
 -<!doctype html>\r
 -<html>\r
 -<head>\r
 -  <title>Popcorn API</title>\r
 -  <link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">\r
 -\r
 -      <style>\r
 -              body {\r
 -                      margin: 3px;\r
 -                      padding: 0px;\r
 -              }\r
 -              h3 {\r
 -                      margin: 3px;\r
 -                      padding: 0px;\r
 -              }\r
 -              h2 {\r
 -                      display: inline;\r
 -                      margin: 3px;\r
 -                      padding: 0px;\r
 -              }               \r
 -              .pass {\r
 -                      color: #33FF00;\r
 -              }\r
 -              .expect {\r
 -                      color: #2d2d2d;\r
 -              }               \r
 -              .fail {\r
 -                      color: #FF0000;\r
 -              }\r
 -      </style>\r
 -      <script src="jquery.js"></script>\r
 -  <script src="../popcorn.js"></script>\r
 -  <script>\r
 -      (function( Popcorn, $ ) {\r
 -\r
 -              var readyCalled = 0, \r
 -                              readyOrder = [], \r
 -                              readyComposed = "Ready Callback 1,Ready Callback 2", \r
 -                              results = {\r
 -                                      pass: 0, \r
 -                                      fail: 0,\r
 -                                      expect: 2\r
 -                              };\r
 -\r
 -              $(function() {\r
 -                readyCalled++;\r
 -              });\r
 -\r
 -              Popcorn(function (e) {\r
 -\r
 -                readyCalled++;\r
 -                readyOrder.push("Ready Callback 1");\r
 -                \r
 -                Popcorn("#video").exec( 1, function () {\r
 -\r
 -                              results[ \r
 -                                      ( readyCalled === 3 ? "pass" : "fail" ) \r
 -                              ]++;\r
 -\r
 -                              if ( readyOrder.join(",") === readyComposed ) {\r
 -                                      results.pass++;\r
 -                              }\r
 -\r
 -                              $.each( results, function( name, value ) {\r
 -                                      $("video").before( \r
 -                                              $("<h2>", {\r
 -                                                      className: name, \r
 -                                                      html: name + ": " + value  \r
 -                                              }) \r
 -                                      );\r
 -                              });\r
 -\r
 -                }).play().volume(0);\r
 -                \r
 -              });\r
 -\r
 -              Popcorn(function () {\r
 -                \r
 -                readyCalled++;\r
 -                readyOrder.push("Ready Callback 2");\r
 -\r
 -              });     \r
 -      })( Popcorn, jQuery );\r
 -\r
 -  </script>\r
 -  \r
 -</head>\r
 -<body>\r
 -      <h3>Popcorn(/* DOM Ready */)<h3>\r
 -\r
 -  <video id='video'style="display:none" \r
 -    controls \r
 -    poster="poster.png"> \r
 -\r
 -    <source id='mp4'\r
 -      src="trailer.mp4"\r
 -      type='video/mp4; codecs="avc1, mp4a"'> \r
 -\r
 -    <source id='ogv'\r
 -      src="trailer.ogv"\r
 -      type='video/ogg; codecs="theora, vorbis"'> \r
 -\r
 -    <p>Your user agent does not support the HTML5 Video element.</p> \r
 -\r
 -  </video>   \r
 -</body>\r
 -</html>\r
++<!doctype html>
 +<html>
 +<head>
 +  <title>Popcorn API</title>
 +  <link rel="stylesheet" href="qunit/qunit.css" type="text/css" media="screen">
++
++      <style>
++              body {
++                      margin: 3px;
++                      padding: 0px;
++              }
++              h3 {
++                      margin: 3px;
++                      padding: 0px;
++              }
++              h2 {
++                      display: inline;
++                      margin: 3px;
++                      padding: 0px;
++              }               
++              .pass {
++                      color: #33FF00;
++              }
++              .expect {
++                      color: #2d2d2d;
++              }               
++              .fail {
++                      color: #FF0000;
++              }
++      </style>
++      <script src="jquery.js"></script>
 +  <script src="../popcorn.js"></script>
 +  <script>
-   
-   Popcorn(function (e) {
++      (function( Popcorn, $ ) {
 +
-     console.log("Popcorn(function() { /../ }) 1");
-     
-     var p = Popcorn("#video");
-     
-     
-     p.exec( 4, function () {
++              var readyCalled = 0, 
++                              readyOrder = [], 
++                              readyComposed = "Ready Callback 1,Ready Callback 2", 
++                              results = {
++                                      pass: 0, 
++                                      fail: 0,
++                                      expect: 2
++                              };
 +
-       
++              $(function() {
++                readyCalled++;
++              });
 +
-     }).play();
-     
-   });
++              Popcorn(function (e) {
++
++                readyCalled++;
++                readyOrder.push("Ready Callback 1");
++                
++                Popcorn("#video").exec( 1, function () {
++
++                              results[ 
++                                      ( readyCalled === 3 ? "pass" : "fail" ) 
++                              ]++;
++
++                              if ( readyOrder.join(",") === readyComposed ) {
++                                      results.pass++;
++                              }
++
++                              $.each( results, function( name, value ) {
++                                      $("video").before( 
++                                              $("<h2>", {
++                                                      className: name, 
++                                                      html: name + ": " + value  
++                                              }) 
++                                      );
++                              });
++
++                }).play().volume(0);
++                
++              });
++
++              Popcorn(function () {
++                
++                readyCalled++;
++                readyOrder.push("Ready Callback 2");
++
++              });     
++      })( Popcorn, jQuery );
 +
-   Popcorn(function () {
-   
-     console.log("Popcorn(function() { /../ }) 2");
-   
-   });  
 +  </script>
 +  
 +</head>
 +<body>
-   <video id='video'style="display:" 
++      <h3>Popcorn(/* DOM Ready */)<h3>
++
++  <video id='video'style="display:none" 
 +    controls 
-     poster="http://media.w3.org/2010/05/sintel/poster.png"> 
++    poster="poster.png"> 
 +
 +    <source id='mp4'
-       src="http://media.w3.org/2010/05/sintel/trailer.mp4"
++      src="trailer.mp4"
 +      type='video/mp4; codecs="avc1, mp4a"'> 
 +
 +    <source id='ogv'
-       src="http://media.w3.org/2010/05/sintel/trailer.ogv"
++      src="trailer.ogv"
 +      type='video/ogg; codecs="theora, vorbis"'> 
 +
 +    <p>Your user agent does not support the HTML5 Video element.</p> 
 +
 +  </video>   
 +</body>
 +</html>