diff --git a/share/emscripten/favicon-32x32.png b/share/emscripten/favicon-32x32.png new file mode 100755 index 0000000000..356d915841 Binary files /dev/null and b/share/emscripten/favicon-32x32.png differ diff --git a/share/emscripten/gpac.html b/share/emscripten/gpac.html index b69b051d56..efa8611108 100644 --- a/share/emscripten/gpac.html +++ b/share/emscripten/gpac.html @@ -1,1038 +1,1425 @@ - + - GPAC WASM - + + + +
+ Downloading... +
-
- Home Wiki - GPAC@WASM - Run MP4Box and gpac in your browser ! - +
+
+ +
+
- - - - - - - - - - - - - - - - - - - -
Downloading...
- - - - -
- -
-
- - -
- - - -
- -
- - - - - - - -
+ let fio = { + udta: this.dict.length, + url: url, + _wrap_io: wrap_io, + _pos: 0, + _size: 0, + _stream: null, //FS.open stream object + _file: null, //fileSelector file object + _refs: 0, + _select: 0, + _block_pos_in_file: 0, + _block_pos: 0, //amount of bytes read from block + _ab: null, + _max_bsize: GPAC.read_block_size, //min size, will grow to block_size of fin filter + _discard_next: null, + _timer: null, + _writer: null, + _fetch: null, + _fetch_wait: null, + gfio_url: function() { + return GFIO.get_url(fio._gfio); + } + }; + this.dict.push(fio); + fio._gfio = this.wrap_new(url, fio.udta, this._pf_open, this._pf_seek, (mode==2) ? 0 : this._pf_read, (mode==1) ? 0 : this._pf_write, this._pf_tell, this._pf_eof, 0); + //only run gfio on main thread ? + this.tag_main(fio._gfio); + return fio; + }, + //for file system read, loads next block from file + _load_block: function(fio) { + let max_bsize = fio._max_bsize; + let bsize = (fio._block_pos_in_file + max_bsize > fio._size) ? (fio._size - fio._block_pos_in_file) : max_bsize; + let blob = fio._file.slice(fio._block_pos_in_file, fio._block_pos_in_file + bsize); + let read = new FileReader(); + read.onload = function(evt) { + fio._ab = evt.target.result; + }; + read.readAsArrayBuffer(blob); + } + }; + + - +