]> khamidou — GitHub mirrors - popcorn-js.git/commitdiff
tic #115 javascript command demo
authorScottDowne <sdowne@learn.senecac.on.ca>
Thu, 14 Oct 2010 18:03:32 +0000 (14:03 -0400)
committerScottDowne <sdowne@learn.senecac.on.ca>
Thu, 14 Oct 2010 18:03:32 +0000 (14:03 -0400)
demos/jsCommand/index.html [new file with mode: 0644]
demos/jsCommand/jscommand.xml [new file with mode: 0644]

diff --git a/demos/jsCommand/index.html b/demos/jsCommand/index.html
new file mode 100644 (file)
index 0000000..e732fce
--- /dev/null
@@ -0,0 +1,40 @@
+<html>
+<head>
+  <script src="http://code.jquery.com/jquery.js"></script>
+  <script src="../../popcorn.js"></script>
+</head>
+<body>
+  <div id="videoContainer" style="text-align:center;">
+    <video src="http://scotland.proximity.on.ca/sdowne/dutch.ogg" controls data-timeline-sources="jscommand.xml"></video>
+  </div>
+  <div id="content"><div>
+  <script>
+    var customJS = (function() {
+      var interval;
+      var content = document.getElementById("content");
+      
+      function work() {
+        var item = document.createElement("p");
+        item.innerHTML = "working...";
+        content.appendChild(item);
+      }
+
+      return {
+        start: function() {
+          var item = document.createElement("p");
+          item.innerHTML = "starting...";
+          content.appendChild(item);
+          interval = setInterval(work, 1000);
+        },
+        stop: function() {
+          var item = document.createElement("p");
+          item.innerHTML = "done!";
+          content.appendChild(item);
+          clearInterval(interval);
+        }
+      };
+    })();
+  </script>
+</body>
+</html>
+
diff --git a/demos/jsCommand/jscommand.xml b/demos/jsCommand/jscommand.xml
new file mode 100644 (file)
index 0000000..6d0da27
--- /dev/null
@@ -0,0 +1,5 @@
+<popcorn>
+       <timeline>
+    <javascript in="1" out="10" start="customJS.start" stop="customJS.stop"/>
+       </timeline>
+</popcorn>