Closed AmitMY closed 1 year ago
Can you show me your code that errors? How are you using muxer options?
This is only an error in 3.0.0
const {Muxer, ArrayBufferTarget} = await import('mp4-muxer');
this.videoType = 'mp4';
this.muxer = new Muxer({
target: new ArrayBufferTarget(),
video: {
codec: 'avc',
width: image.width,
height: image.height,
},
});
Ah yes, I incorrectly used generics in the declaration file. I released a fix in v3.0.1, can you please verify?
Given your fix, it doesn't work as is.
It seems like I need to modify my definition to:
new Muxer<ArrayBufferTarget, VideoOptions>({
But I can't import it
No you shouldn't have to update your definition, the generics are inferred from what you pass to the Muxer. What is the error now? From the above example, it seems like you're not passing fastStart
, which is a required property since v3.
This works for me in v3.0.1. Note how the second generic is properly inferred from what gets passed:
with fastStart
, there's no need for explicit typing. thanks!
Because now the default is
undefined
with no way of changing it: https://github.com/Vanilagy/mp4-muxer/blob/main/src/muxer.ts#L33-L36