]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
Minor draft revisions
authorrwldrn <waldron.rick@gmail.com>
Sat, 4 Dec 2010 16:32:05 +0000 (11:32 -0500)
committerrwldrn <waldron.rick@gmail.com>
Sat, 4 Dec 2010 16:32:05 +0000 (11:32 -0500)
popcorn-api-draft.js
test/demo.html
test/demo.js

index 1c506c002c4364a39d540e618002cde201bee4f1..fd1ea207891db4dee8ff23a83a917a1740fbdc2c 100644 (file)
@@ -6,7 +6,6 @@
 //  reference to the window context
 (function(global) {
 
-
   //  Cache refs to speed up calls to native utils
   var  
   forEach = Array.prototype.forEach, 
     })()
   );
   
+  Popcorn.extend(Popcorn.p, {
+    
+    setCommand: function() {
+    
+    }, 
+    getCommand: function() {
+    
+    }, 
+    toTrack: function( setup ) {
+      /*
+      {
+        in: ts,
+        out: ts, 
+        command: f()
+      }
+      */
+      // stores the command in a track
+    }
+  
+  });
+  
   var nativeEvents = "loadstart progress suspend emptied stalled play pause " + 
                      "loadedmetadata loadeddata waiting playing canplay canplaythrough " + 
                      "seeking seeked timeupdate ended ratechange durationchange volumechange";
           }, false);
         
         }
-        
         return this;
+      }, 
+      special: {
+        // handles timeline controllers
+        play: function () {
+          //  renders all of the interally stored track commands
+        }
       }
     }
   };
     
     Popcorn.extend( Popcorn.p, plugin );
     
-    
     if ( Popcorn.registry ) {
       Popcorn.registry.push({ 
         name: name,
       });
     }
     
-    //  within the context of a plugin, the `timeupdate` or any of the events can be listened to 
+    //  within the context of a plugin
+    //  any of the events can be listened to 
   };
   
 
   global.Popcorn = Popcorn;
   
-})(window);
\ No newline at end of file
+})(window);
index c96fe024eb314eba51187269e241943062e50067..156d7f6ff99e0dc897035b5b8a3da8a176932c8c 100644 (file)
@@ -1,14 +1,14 @@
 <!DOCTYPE html>
 <html>
 <head>
-  <title>Popcorn API DEMO</title>
+  <title>Popcorn API Draft DEMO</title>
   
   <script src="jquery.js"></script>
   <script src="../popcorn-api-draft.js"></script>
   <script src="demo.js"></script>
 </head>
 <body>
-  <h1 id="qunit-header">Popcorn API</h1>
+  <h1 id="qunit-header">Popcorn API Draft</h1>
   
   <style>
     /* test positioning  */
 
     </video> 
   </div>
-  
-  
-  
-  
-  
-  
 </body>
 </html>
index 69b5f517441475f337726e2394efc161c749834e..7bb8266fd78b93045090189e33bb8b3bbaf8d891 100644 (file)
@@ -1,17 +1,12 @@
-
 // EXAMPLE PLUGIN: SUBTITLER
 
 (function (Popcorn) {
   
-  
-  
-  
   Popcorn.plugin( "subtitler" , function ( options ) {
     
     var subtitles = [], 
         context = this.video, 
         div = document.getElementById("subtitle-container");
-        
     
     //  Check for existing frame
     if ( !div ) {
@@ -44,7 +39,6 @@
     
     this.listen("timeupdate", function (event) {
       
-      
       Popcorn.forEach(subtitles, function ( subtitle ) {
         
         var temp  = div.querySelectorAll( subtitle.id );
@@ -61,7 +55,6 @@
             });
           }
         }
-        
       }, this);
     });
   });
 
 $(function () {
 
-  
-  
   var p = Popcorn('#video');
   
-  
   p.play();  
   
-  
+ 
   p.subtitler({
     id: "#subtitle-a", 
     start: 2, // seconds
@@ -89,8 +79,6 @@ $(function () {
     html: '<p id="subtitle-a">Appear at 2 second mark, dissappear at 5 second mark</p>'
   });
   
-  
-  
   // Butter would generate the data to populate this api function call's argument
   
   p.subtitler([
@@ -123,4 +111,4 @@ $(function () {
   
 
 
-});
\ No newline at end of file
+});