Skip to content

Commit dfd5581

Browse files
add a specific log warn
1 parent d21f9b2 commit dfd5581

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

‎src/compat/eme/get_init_data.ts‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,11 +150,16 @@ export default function getInitData(
150150
encryptedEvent: IMediaEncryptedEvent,
151151
): IEncryptedEventData | null {
152152
const { initData, initDataType, forceSessionRecreation } = encryptedEvent;
153-
if (isNullOrUndefined(initData) || initData.byteLength === 0) {
153+
if (isNullOrUndefined(initData)) {
154154
log.warn("DRM", "No init data found on media encrypted event.");
155155
return null;
156156
}
157157

158+
if (initData.byteLength === 0) {
159+
log.warn("DRM", "Init data is empty on media encrypted event.");
160+
return null;
161+
}
162+
158163
const initDataBytes = new Uint8Array(initData);
159164
const values = getInitializationDataValues(initDataBytes);
160165
return { type: initDataType, values, forceSessionRecreation };

0 commit comments

Comments
 (0)