+ var subset = file.slice(offset, offset + length);
+ reader.readAsArrayBuffer(subset);
+ };
+
+ checkForMoovAtom(0);
+ }
+
+ function toDOMRepresentation(object)
+ {
+ if (object instanceof Atom)
+ return toDOMNode(object);
+ else if (object instanceof Array) {
+ var span = document.createElement('span');
+ span.appendChild(document.createTextNode('['));
+ for (var i = 0; i < object.length; ++i) {
+ span.appendChild(toDOMRepresentation(object[i]));
+ if (i + 1 < object.length)
+ span.appendChild(document.createTextNode(', '));
+ }
+ span.appendChild(document.createTextNode(']'));
+ return span;
+ }
+ else if (typeof(object) == "string")
+ return document.createTextNode('"' + object + '"');
+ else if (object instanceof Date)
+ return document.createTextNode(object.toLocaleString());
+ else
+ return document.createTextNode(object.toString());
+ }
+
+ function toDOMNode(object)
+ {
+ var output = document.createElement('dl');
+
+ for (property in object) {
+ var value = object[property];
+ if (typeof(value) == 'function')
+ continue;
+ var div = document.createElement('div');
+ var dt = document.createElement('dt');
+ dt.appendChild(document.createTextNode(property));
+ var dd = document.createElement('dd');
+ dd.appendChild(toDOMRepresentation(value));
+ div.appendChild(dt);
+ div.appendChild(dd);
+ output.appendChild(div);
+ }
+ return output;