]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
ticket #138 initial update call
authorScottDowne <sdowne@learn.senecac.on.ca>
Thu, 18 Nov 2010 17:03:47 +0000 (12:03 -0500)
committerScottDowne <sdowne@learn.senecac.on.ca>
Thu, 18 Nov 2010 17:03:47 +0000 (12:03 -0500)
demos/initUpdate/init.html [new file with mode: 0644]
demos/initUpdate/init.xml [new file with mode: 0644]
popcorn.js

diff --git a/demos/initUpdate/init.html b/demos/initUpdate/init.html
new file mode 100644 (file)
index 0000000..fe43af9
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <script src="../../popcorn.js"></script>
+  </head>
+  <body>
+    <video src="http://scotland.proximity.on.ca/sdowne/dutch.ogg" controls data-timeline-sources="init.xml" height="280px" width="370px"></video>
+  </body>
+</html>
diff --git a/demos/initUpdate/init.xml b/demos/initUpdate/init.xml
new file mode 100644 (file)
index 0000000..2457c16
--- /dev/null
@@ -0,0 +1,5 @@
+<popcorn>
+       <timeline>
+    <subtitle>init subtitle</subtitle> <!-- no in and out defaults to in="0" out="video's duration" -->
+       </timeline>
+</popcorn>
index 60978ae301720acc8b6f24c5ae7eb786eb7ce258..c856fc4b561f392d7b6da128ec5279696117266e 100644 (file)
     for (var j in vid.videoManager.commandObjects) {
       if (vid.videoManager.commandObjects.hasOwnProperty(j)) {
         commandObject = vid.videoManager.commandObjects[j];
-        if (!commandObject.loaded && (commandObject.params["in"] - 5) < t && commandObject.params["out"] > t) {
+        if (!commandObject.loaded && (commandObject.params["in"] - 5) <= t && commandObject.params["out"] > t) {
           commandObject.loaded = true;
           commandObject.preload();
         }
-        if (!commandObject.running && commandObject.params["in"] < t && commandObject.params["out"] > t) {
+        if (!commandObject.running && commandObject.params["in"] <= t && commandObject.params["out"] > t) {
           commandObject.running = true;
           
           $("#" + commandObject.params.target + " .inactive").hide();
         clearInterval(si);
         convert(data, manager, type);
         manager.loaded();
+        popcorn.update(video);
     }, 50);
   };