puppeteer-stream
puppeteer-stream copied to clipboard
Improvement: invoke and wait for recorder.requestData when closing stream
Right now whenever you stream.destroy
, there is a chance that there is still a Blob forming if your frameSize
was set to a high number eg. 120s. But this is not checked or accounted for, meaning that stream.destroy
invocation would essentially get rid of that last <120s that was still in memory.
Calling recorder.requestData()
before closing everything (stream/recorder/ws) and awaiting it somehow would be the fix for this, but at this point the way closing
or finishing
the whole chain of everything works is very hacky and not async at all, surviving on setTimeouts, which is a very no-no.
Will have to look into this in the future.