feat: add visionOS support (#3425)
* feat: add visionOS to target platforms * disable unsupported API * add temporary `promises` patches * fix(visionOS): update promises patches * apply code review suggestions * format code
This commit is contained in:
@@ -78,24 +78,21 @@ enum RCTVideoDRM {
|
||||
contentIdData: Data
|
||||
) -> Promise<Data> {
|
||||
return Promise<Data>(on: .global()) { fulfill, reject in
|
||||
var spcError: NSError!
|
||||
var spcData: Data?
|
||||
do {
|
||||
spcData = try loadingRequest.streamingContentKeyRequestData(forApp: certificateData, contentIdentifier: contentIdData as Data, options: nil)
|
||||
} catch _ {
|
||||
print("SPC error")
|
||||
}
|
||||
#if os(visionOS)
|
||||
// TODO: DRM is not supported yet on visionOS. See #3467
|
||||
reject(NSError(domain: "DRM is not supported yet on visionOS", code: 0, userInfo: nil))
|
||||
#else
|
||||
guard let spcData = try? loadingRequest.streamingContentKeyRequestData(
|
||||
forApp: certificateData,
|
||||
contentIdentifier: contentIdData as Data,
|
||||
options: nil
|
||||
) else {
|
||||
reject(RCTVideoErrorHandler.noSPC)
|
||||
return
|
||||
}
|
||||
|
||||
if spcError != nil {
|
||||
reject(spcError)
|
||||
}
|
||||
|
||||
guard let spcData else {
|
||||
reject(RCTVideoErrorHandler.noSPC)
|
||||
return
|
||||
}
|
||||
|
||||
fulfill(spcData)
|
||||
fulfill(spcData)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user