]> id.pley.net Git - movie_parser.git/blobdiff - AtomTester.html
Support ftyp, moov, and mhdr atoms.
[movie_parser.git] / AtomTester.html
index 789e24633336267030f319cbd398e8787206729f..82d9be2727d03348c6799746eb4012bf8201a5c8 100644 (file)
             reader.onload = (function(file) {
                 return function(e) {
                     var offset = 0;
+                    var output = document.getElementById('output');
+                    output.innerHTML = '';
                     while (offset < e.target.result.byteLength) {
-                        var atom = new Atom(e.target.result, offset);
+                        var atom = Atom.create(e.target.result, offset);
                         if (!atom)
                             break;
                         atoms.push(atom);
+                        output.appendChild(atom.toDOMNode());
                         offset += atom.size;
                     }
                 };
             document.getElementById('file').addEventListener('change', onFileSelect, false);
         }
     </script>
+    <style>
+        dl { border: 1px solid black; }
+        dt, dd { display: inline; }
+        dt:after { content:": " }
+        dd:after { content:"\A"; white-space:pre; }
+        dd ol { display: inline-block; margin: 0; vertical-align: top }
+        
+        /* make the output display as a table */
+        dl { display: table; }
+        dl div { display: table-row; }
+        dt, dd { display: table-cell; }
+    </style>
 </head>
 <body id="atomtester" onload="setup()">
     <input type="file" id="file" name="file" />
+    <div id=output>
 </body>
\ No newline at end of file