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),
);
}