]> id.pley.net Git - movie_parser.git/blobdiff - SceneFinder.html
Upload Dropbox.com versions of everything
[movie_parser.git] / SceneFinder.html
diff --git a/SceneFinder.html b/SceneFinder.html
new file mode 100755 (executable)
index 0000000..7ae6d54
--- /dev/null
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<head>
+    <meta http-equiv="Content-type" content="text/html; charset=utf-8">
+    <title>SceneFinder</title>
+    <script src=Atom.js></script>
+    <script src=SampleData.js></script>
+    <script>
+        // Add Blob.prototype.slice if it does not already exist:
+        if (typeof(Blob.prototype.slice) == 'undefined' && typeof(Blob.prototype.webkitSlice) != 'undefined')
+            Blob.prototype.slice = Blob.prototype.webkitSlice;
+
+        var sampleData = null;
+
+        function onFileSelect(e) {
+            var file = e.target.files[0];
+            output.innerHTML = '';
+            sampleData = new SampleData();
+            sampleData.load(file, function(){
+                var video = document.createElement('video');
+                               var url = window.URL.createObjectURL(file);
+                video.src = url;
+                video.controls = true;
+                output.appendChild(video);
+                
+                var ol = document.createElement('ol');
+                output.appendChild(ol);
+                for (var i = 0; i < sampleData.sceneSamples.length; ++i) {
+                    var li = document.createElement('li');
+                    ol.appendChild(li);
+                    
+                    var a = document.createElement('a');
+                    li.appendChild(a);
+                    a.href = '#';
+                    a.time = sampleData.sceneSamples[i][0];
+                    a.onclick = function(e) {
+                                               video.currentTime = e.target.time;
+                                       };
+                    a.innerText = 'Chapter ' + i;
+                }
+            });
+        }
+
+        function setup() {
+            document.getElementById('file').addEventListener('change', onFileSelect, false);
+        }
+    </script>
+</head>
+<body onload="setup()">
+    <input type="file" id="file" name="file" />
+    <div id=output></div>
+</body>
\ No newline at end of file