Closed jynxio closed 7 months ago
same here. did you find any solution?
same here. did you find any solution?
not yet
In addition to that - the latest release didn't publish assets like it did before, so that's also one more reason why the sample code fails. Talking about this URL https://github.com/videojs/mux.js/releases/latest/download/mux.js
.
But the core of the reported problem is that with the current code sample, we're getting two data
events for one updateend
event of source buffer. So yes the current SourceBuffer is still in the appendBuffer
state.
The simplest 1 line change we can make seems to me like this:
function appendNextSegment(){
// reset the 'data' event listener to just append (moof/mdat) boxes to the Source Buffer
transmuxer.off('data');
transmuxer.on('data', (segment) =>{
sourceBuffer.appendBuffer(new Uint8Array(segment.data));
transmuxer.off('data'); // ⬅️ 🆕 This is added, to close the listener for the current append.
})
// ... rest of the code
}
Discretion
The sample code of README.md does not work, it will throw this error:
The specific location of the error is here:
Screenshot
Environment
platform: chrome ( 97.0.4692.71 ), Windows10