]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
trying two maps
authorAnna Sobiepanek <annaopensource@gmail.com>
Tue, 14 Dec 2010 01:26:37 +0000 (20:26 -0500)
committerAnna Sobiepanek <annaopensource@gmail.com>
Tue, 14 Dec 2010 01:26:37 +0000 (20:26 -0500)
plugins/googleMap/popcorn.googleMap.html
plugins/googleMap/popcorn.googleMap.unit.js [new file with mode: 0644]

index 060bd2b6c0ffa67e38cc44fa19a7ea4a12f135ff..2ed21d02a84dbe9ee59a0155c69c8ad412df8920 100644 (file)
@@ -8,22 +8,33 @@
   <script>
     document.addEventListener('DOMContentLoaded', function () {
       var p = Popcorn('#video')
+      .volume(0)
       .play() 
       .googleMap({
-        start: 5, // seconds
-        end: 45, // seconds
+        start: 0, // seconds
+        end: 10, // seconds
         type: 'ROADMAP',
         target: 'map',
         lat: 43.665429,
         long: -79.403323,
         zoom: 10
+      } )
+      .googleMap({
+        start: 15, // seconds
+        end: 50, // seconds
+        type: 'SATELLITE',
+        target: 'map2',
+        lat: -23.5489,
+        long: -46.6388,
+        zoom: 10
       } );
     }, false);
   </script>
 </head>
 <body>
   <h1 id="qunit-header">Popcorn google Map Plug-in Demo</h1>
-  <p> A Google Map  displaying Toronto, Ontario will appear at 5 seconds and disappear at 45 seconds.</p>
+  <p> A Google Map  displaying Toronto, Ontario will appear at 0 seconds and disappear at 10 seconds.</p>
+  <p> A Google Map  displaying Toronto, Ontario will appear at 15 seconds and disappear at 25 seconds.</p>
   <div>
     <video id='video' 
       controls preload='none' 
@@ -42,7 +53,9 @@
 
     </video> 
   </div>
-  <div id="map" style="width:400px;height:400px"><p>Locations in this video:</p>
+  <div style="width:700px">
+    <div id="map" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
+    <div id="map2" style="position:relative;float:left;width:300px;height:400px"><p>Locations in this video:</p></div>
   </div>
 </body>
 </html>
diff --git a/plugins/googleMap/popcorn.googleMap.unit.js b/plugins/googleMap/popcorn.googleMap.unit.js
new file mode 100644 (file)
index 0000000..7877ca1
--- /dev/null
@@ -0,0 +1,66 @@
+test("Popcorn Google Map Plugin", function () {
+  
+  var popped = Popcorn("#video"),
+      expects = 5, 
+      count = 0,
+      iframeInterval,
+      iframeInterval2,
+      iframeInterval3,
+      iframeInterval4;
+  
+  expect(expects);
+  
+  function plus() {
+    if ( ++count===expects) {
+      start();
+    }
+  }
+  
+  stop();
+   
+  ok ('footnote' in popped, "footnote is a mehtod of the popped instance");
+  plus();
+  
+  ok ( document.getElementById('footnotediv').innerHTML === "", "initially, there is nothing inside the footnotediv" );
+  plus();
+  //equals( actual, expected, message ) instead of ok( boolean true, message )
+  popped.footnote({
+      start: 5, // seconds
+      end: 15, // seconds
+      text: 'This video made exclusively for drumbeat.org',
+      target: 'footnotediv'
+    } )
+    .footnote({
+      start: 35, // seconds
+      end: 45, // seconds
+      text: 'Visit webmademovies.org for more details',
+      target: 'footnotediv'
+    } )
+    .play();
+  
+  
+  interval = setInterval( function() {
+    if( popped.currentTime() > 5 && popped.currentTime() <= 15 ) {
+      ok (document.getElementById('footnotediv').innerHTML === "This video made exclusively for drumbeat.org", "footnote displaing correct information" );
+      plus();
+      clearInterval( interval );
+    }
+  }, 5000);
+  
+  interval2 = setInterval( function() {
+    if( popped.currentTime() > 15 && popped.currentTime() < 35  ) {
+      ok (document.getElementById('footnotediv').innerHTML === "", "footnote cleared properly" );
+      plus();
+      clearInterval( interval2 );
+    }
+  }, 5000);
+  
+  interval3 = setInterval( function() {
+    if( popped.currentTime() > 35 && popped.currentTime() < 45 ) {
+      ok (document.getElementById('footnotediv').innerHTML === "Visit webmademovies.org for more details", "footnote displaing correct information" );
+      plus();
+      clearInterval( interval3 );
+    }
+  }, 5000);
+  
+});