Add missing validation for sizeChangeBehavior

This commit is contained in:
Vanilagy
2025-08-30 17:04:30 +02:00
parent 35036f6621
commit 137f82cc94
+9 -1
View File
@@ -79,7 +79,15 @@ export const validateVideoEncodingConfig = (config: VideoEncodingConfig) => {
) {
throw new TypeError('config.keyFrameInterval, when provided, must be a non-negative number.');
}
// todo here
if (
config.sizeChangeBehavior !== undefined
&& !['deny', 'passThrough', 'fill', 'contain', 'cover'].includes(config.sizeChangeBehavior)
) {
throw new TypeError(
'config.sizeChangeBehavior, when provided, must be \'deny\', \'passThrough\', \'fill\', \'contain\''
+ ' or \'cover\'.',
);
}
if (config.onEncodedPacket !== undefined && typeof config.onEncodedPacket !== 'function') {
throw new TypeError('config.onEncodedChunk, when provided, must be a function.');
}