Skip to content

Commit

Permalink
Non-transferable SharedArrayBuffer payload support
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Oct 12, 2017
1 parent 4463eda commit 0155346
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions doc/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ Note: If `fLoader` or `pLoader` are used, they overwrite `loader`!
@callback onSuccessCallback
@param response {object} - response data
@param response.url {string} - response URL (which might have been redirected)
@param response.data {string/arraybuffer} - response data (reponse type should be as per context.responseType)
@param response.data {string/arraybuffer/sharedarraybuffer} - response data (reponse type should be as per context.responseType)
@param stats {object} - loading stats
@param stats.trequest {number} - performance.now() just after load() has been called
@param stats.tfirst {number} - performance.now() of first received byte
Expand All @@ -657,7 +657,7 @@ Note: If `fLoader` or `pLoader` are used, they overwrite `loader`!
@param [stats.total] {number} - total nb of bytes
@param [stats.bw] {number} - current download bandwidth in bit/s (monitored by ABR controller to control emergency switch down)
@param context {object} - loader context
@param data {string/arraybuffer} - onProgress data (should be defined only if context.progressData === true)
@param data {string/arraybuffer/sharedarraybuffer} - onProgress data (should be defined only if context.progressData === true)
@param networkDetails {object} - loader network details (the xhr for default loaders)
@callback onErrorCallback
Expand Down
4 changes: 2 additions & 2 deletions src/demux/demuxer.js
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ class Demuxer {
}
this.frag = frag;
if (w) {
// post fragment payload as transferable objects (no copy)
w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, [data]);
// post fragment payload as transferable objects for ArrayBuffer (no copy)
w.postMessage({cmd: 'demux', data, decryptdata, initSegment, audioCodec, videoCodec, timeOffset, discontinuity, trackSwitch, contiguous, duration, accurateTimeOffset,defaultInitPTS}, data instanceof ArrayBuffer ? [data] : []);
} else {
let demuxer = this.demuxer;
if (demuxer) {
Expand Down

0 comments on commit 0155346

Please sign in to comment.