mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-10-03 13:53:53 +02:00
Add missing validation for sizeChangeBehavior
This commit is contained in:
+9
-1
@@ -79,7 +79,15 @@ export const validateVideoEncodingConfig = (config: VideoEncodingConfig) => {
|
|||||||
) {
|
) {
|
||||||
throw new TypeError('config.keyFrameInterval, when provided, must be a non-negative number.');
|
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') {
|
if (config.onEncodedPacket !== undefined && typeof config.onEncodedPacket !== 'function') {
|
||||||
throw new TypeError('config.onEncodedChunk, when provided, must be a function.');
|
throw new TypeError('config.onEncodedChunk, when provided, must be a function.');
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user