gpac / mp4box.js

JavaScript version of GPAC's MP4Box tool
https://gpac.github.io/mp4box.js/
BSD 3-Clause "New" or "Revised" License
1.98k stars 333 forks source link

Bug: Small chunk size will not fire "onSamples" #205

Closed motoyasu-yamada closed 3 years ago

motoyasu-yamada commented 4 years ago

When "the sample does not end in this buffer" in function "ISOFile.getSample", subsequent partials will not be loaded. Then "getSmaple" return null.

processSamples function in isofile.js receive null and so will not fire "onSamples".

ISOFile.prototype.processSamples = function(last) {
:
                var sample = this.getSample(trak, trak.nextSample);
                if (sample) {
                    trak.nextSample++;
                    extractTrak.samples.push(sample);
                } else {
                    break;
                }
dalecurtis commented 4 years ago

Awesome, thanks for the fix!

dalecurtis commented 4 years ago

Bump @cconcolato since a lot of folks hit this issue when trying to use the streaming API.

cconcolato commented 3 years ago

The issue should be fixed with https://github.com/gpac/mp4box.js/commit/2bfb7a53d8a66db846c26375c2693de1b7cd4c5b. Please open a new issue if this is not the case.

elhigu commented 3 years ago

Is this already released in npm? I could try it out.

cconcolato commented 3 years ago

Yes, should be in latest npm version (0.4.1)