fix(ios): fairplay different key per asset (#3261)

* [Fix] Replace _loadingRequest instance with _loadingRequests dictionary to support multiple concurrent requests
* Remove stored finished requests from dictionary
* Keep contentId as is, and send loadingRequest.url in licenseUrl.
* Update DRM.md

---------

Co-authored-by: Facundo Gutierrez <facundo.gutierrez@tcc.com.uy>
This commit is contained in:
Facundo Gutierrez
2023-10-05 16:37:28 -03:00
committed by GitHub
parent c6ee294403
commit f4acaccd80
6 changed files with 80 additions and 52 deletions

View File

@@ -24,26 +24,26 @@ class RCTVideoManager: RCTViewManager {
})
}
@objc(setLicenseResult:reactTag:)
func setLicenseResult(license: NSString, reactTag: NSNumber) -> Void {
@objc(setLicenseResult:licenseUrl:reactTag:)
func setLicenseResult(license: NSString, licenseUrl:NSString, reactTag: NSNumber) -> Void {
bridge.uiManager.prependUIBlock({_ , viewRegistry in
let view = viewRegistry?[reactTag]
if !(view is RCTVideo) {
RCTLogError("Invalid view returned from registry, expecting RCTVideo, got: %@", String(describing: view))
} else if let view = view as? RCTVideo {
view.setLicenseResult(license as String)
view.setLicenseResult(license as String, licenseUrl as String)
}
})
}
@objc(setLicenseResultError:reactTag:)
func setLicenseResultError(error: NSString, reactTag: NSNumber) -> Void {
@objc(setLicenseResultError:licenseUrl:reactTag:)
func setLicenseResultError(error: NSString, licenseUrl:NSString, reactTag: NSNumber) -> Void {
bridge.uiManager.prependUIBlock({_ , viewRegistry in
let view = viewRegistry?[reactTag]
if !(view is RCTVideo) {
RCTLogError("Invalid view returned from registry, expecting RCTVideo, got: %@", String(describing: view))
} else if let view = view as? RCTVideo {
view.setLicenseResultError(error as String)
view.setLicenseResultError(error as String, licenseUrl as String)
}
})
}