]> id.pley.net Git - movie_parser.git/blobdiff - AtomTester.html
Fixed TrackHeaderAtom inheritance chain, which was causing a parsing bug. Made the...
[movie_parser.git] / AtomTester.html
index d0bcbf133020e5d26f5e630ddd3b8789e1edbbfb..26172643932f28a827bb6ebe664a8f5b0f1da7ee 100644 (file)
@@ -3,6 +3,10 @@
     <title>AtomTester</title>
     <script src=Atom.js></script>
     <script>
     <title>AtomTester</title>
     <script src=Atom.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 moovAtom;
         function onFileSelect(e) {
             var file = e.target.files[0];
         var moovAtom;
         function onFileSelect(e) {
             var file = e.target.files[0];
@@ -20,7 +24,7 @@
                     else
                         checkForMoovAtom(offset + basicAtom.size);
                 };
                     else
                         checkForMoovAtom(offset + basicAtom.size);
                 };
-                var subset = file.webkitSlice(offset, offset + 16);
+                var subset = file.slice(offset, offset + 16);
                 reader.readAsArrayBuffer(subset);
             };
             
                 reader.readAsArrayBuffer(subset);
             };
             
@@ -30,7 +34,7 @@
                     var output = document.getElementById('output');
                     output.appendChild(toDOMNode(moovAtom));
                 };
                     var output = document.getElementById('output');
                     output.appendChild(toDOMNode(moovAtom));
                 };
-                var subset = file.webkitSlice(offset, offset + length);
+                var subset = file.slice(offset, offset + length);
                 reader.readAsArrayBuffer(subset);
             };
             
                 reader.readAsArrayBuffer(subset);
             };
             
@@ -70,7 +74,7 @@
                     continue;
                 var div = document.createElement('div');
                 var dt = document.createElement('dt');
                     continue;
                 var div = document.createElement('div');
                 var dt = document.createElement('dt');
-                dt.innerText = property;
+                dt.appendChild(document.createTextNode(property));
                 var dd = document.createElement('dd');
                 dd.appendChild(toDOMRepresentation(value));
                 div.appendChild(dt);
                 var dd = document.createElement('dd');
                 dd.appendChild(toDOMRepresentation(value));
                 div.appendChild(dt);