Vanilagy / webm-muxer

WebM multiplexer in pure TypeScript with support for WebCodecs API, video & audio.
https://vanilagy.github.io/webm-muxer/demo
MIT License
197 stars 12 forks source link

StreamTarget onDone not available anymore since v4.0.0 #33

Closed carstenbittrich-goto closed 4 months ago

carstenbittrich-goto commented 6 months ago

Hi, we noticed that you removed the onDone method of StreamTarget in v4.0.0. Is there an alternative way to know reliably when all data has passed through the muxer once muxer.finalize() has been called? We forward the data send via StreamTarget to a file, but can't use FileSystemWritableFileStream directly for various reasons and used the onDone method to trigger to close the file handle.

Vanilagy commented 6 months ago

Kudos for catching it! I removed the onDone callback since it was simply always called at the end of .finalize() and therefore was not providing any new information.

Assume that once .finalize() returns, no more data will be sent to the StreamTarget, so whichever logic you placed into onDone, you should place it after .finalize().