mirror of
https://github.com/arcodange-org/mediabunny.git
synced 2026-09-28 03:13:51 +02:00
Add missing validation for HlsInputFormatOptions
This commit is contained in:
@@ -789,4 +789,15 @@ export const validateInputFormatOptions = (options: InputFormatOptions, prefix:
|
||||
throw new TypeError(`${prefix}.isobmff.resolveKeyId, when provided, must be a function.`);
|
||||
}
|
||||
}
|
||||
if (options.hls !== undefined) {
|
||||
if (!options.hls || typeof options.hls !== 'object') {
|
||||
throw new TypeError(`${prefix}.hls, when provided, must be an object.`);
|
||||
}
|
||||
if (
|
||||
options.hls.offsetTimestampsByDateTime !== undefined
|
||||
&& typeof options.hls.offsetTimestampsByDateTime !== 'boolean'
|
||||
) {
|
||||
throw new TypeError(`${prefix}.hls.offsetTimestampsByDateTime, when provided, must be a boolean.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user