1 parent d21f9b2 commit dfd5581Copy full SHA for dfd5581
1 file changed
src/compat/eme/get_init_data.ts
@@ -150,11 +150,16 @@ export default function getInitData(
150
encryptedEvent: IMediaEncryptedEvent,
151
): IEncryptedEventData | null {
152
const { initData, initDataType, forceSessionRecreation } = encryptedEvent;
153
- if (isNullOrUndefined(initData) || initData.byteLength === 0) {
+ if (isNullOrUndefined(initData)) {
154
log.warn("DRM", "No init data found on media encrypted event.");
155
return null;
156
}
157
158
+ if (initData.byteLength === 0) {
159
+ log.warn("DRM", "Init data is empty on media encrypted event.");
160
+ return null;
161
+ }
162
+
163
const initDataBytes = new Uint8Array(initData);
164
const values = getInitializationDataValues(initDataBytes);
165
return { type: initDataType, values, forceSessionRecreation };
0 commit comments