File tree Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Expand file tree Collapse file tree 2 files changed +23
-3
lines changed Original file line number Diff line number Diff line change @@ -151,7 +151,16 @@ const AVComponentsLoaded = loadPolyfills().catch((error) => {
151151} )
152152
153153export const createEncodedAudioChunk = ( input ) => {
154- return new EncodedAudioChunk ( input )
154+ const init = { ...input , transfer : [ ] }
155+ const data = init . data
156+ if ( data ) {
157+ if ( data instanceof ArrayBuffer ) {
158+ init . transfer . push ( data )
159+ } else if ( ArrayBuffer . isView ( data ) ) {
160+ init . transfer . push ( data . buffer )
161+ }
162+ }
163+ return new EncodedAudioChunk ( init )
155164}
156165
157166export const createAudioData = ( input ) => {
Original file line number Diff line number Diff line change @@ -1485,8 +1485,19 @@ class AVVideoOutputProcessor extends AVOutputProcessor {
14851485 } )
14861486
14871487 this . decrypt = new AVDecrypt ( {
1488- // eslint-disable-next-line no-undef
1489- chunkMaker : ( arg ) => new EncodedVideoChunk ( arg ) ,
1488+ chunkMaker : ( arg ) => {
1489+ const init = { ...arg , transfer : [ ] }
1490+ const data = init . data
1491+ if ( data ) {
1492+ if ( data instanceof ArrayBuffer ) {
1493+ init . transfer . push ( data )
1494+ } else if ( ArrayBuffer . isView ( data ) ) {
1495+ init . transfer . push ( data . buffer )
1496+ }
1497+ }
1498+ // eslint-disable-next-line no-undef
1499+ return new EncodedVideoChunk ( init )
1500+ } ,
14901501 keyStore : KeyStore . getKeyStore ( )
14911502 } )
14921503
You can’t perform that action at this time.
0 commit comments