fix(ios): split licenseUrl and loadedLicenseUrl (#3578)

* fix(ios): split licenseUrl and loadedLicenseUrl
* fix(ios): fix drm license url used to provide the answer
This commit is contained in:
Olivier Bouillet
2024-03-12 16:47:49 +01:00
committed by GitHub
parent 6184c10acc
commit 7c4d19fa72
7 changed files with 107 additions and 93 deletions

View File

@@ -438,6 +438,7 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
data.spcBase64,
data.contentId,
data.licenseUrl,
data.loadedLicenseUrl,
);
const getLicensePromise = Promise.resolve(getLicenseOverride); // Handles both scenarios, getLicenseOverride being a promise and not.
getLicensePromise
@@ -446,14 +447,14 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
nativeRef.current &&
VideoManager.setLicenseResult(
result,
data.licenseUrl,
data.loadedLicenseUrl,
getReactTag(nativeRef),
);
} else {
nativeRef.current &&
VideoManager.setLicenseResultError(
'Empty license result',
data.licenseUrl,
data.loadedLicenseUrl,
getReactTag(nativeRef),
);
}
@@ -462,14 +463,14 @@ const Video = forwardRef<VideoRef, ReactVideoProps>(
nativeRef.current &&
VideoManager.setLicenseResultError(
'fetch error',
data.licenseUrl,
data.loadedLicenseUrl,
getReactTag(nativeRef),
);
});
} else {
VideoManager.setLicenseResultError(
'No spc received',
data.licenseUrl,
data.loadedLicenseUrl,
getReactTag(nativeRef),
);
}

View File

@@ -243,6 +243,7 @@ export type OnExternalPlaybackChangeData = Readonly<{
export type OnGetLicenseData = Readonly<{
licenseUrl: string;
loadedLicenseUrl: string;
contentId: string;
spcBase64: string;
}>;

View File

@@ -54,6 +54,7 @@ export type Drm = Readonly<{
/* eslint-disable @typescript-eslint/no-unused-vars */
getLicense?: (
licenseUrl: string,
loadedLicenseUrl: string,
contentId: string,
spcBase64: string,
) => void; // ios