yusitnikov / fix-webm-duration

navigator.mediaDevices.getUserMedia + MediaRecorder create WEBM files without duration metadata. This library appends missing metadata section right to the file blob.
MIT License
248 stars 48 forks source link

suggestion: return a promise #3

Closed lr-mjaouen closed 3 years ago

lr-mjaouen commented 3 years ago

Hey, thank you it seems to work like a charm! Just a suggestion, maybe it would be better to return directly a promise instead of a callback?

yusitnikov commented 3 years ago

Glad that my small library helped you :) Initially, I didn't return a promise because this library is targeting old browsers where promises are not supported. But you're welcome to open a pull request with returning a promise object when it's available.

lr-mjaouen commented 3 years ago

To be honest I don't intend to spend more time on this, I hope this will be fixed by itself soon. I need to take a look at https://github.com/legokichi/ts-ebml it might solve other possible issues I could encounter among this one but probably too heavier for the moment (your solution is all I need so far). Thank you again, have a nice day!

yusitnikov commented 2 years ago

Update: added promise support at v1.0.1 - skip the callback argument and the function will return a promise