From c9a75f3cde82f55e612b9e2c30ca06db3093b283 Mon Sep 17 00:00:00 2001 From: YangJH Date: Tue, 26 Mar 2024 21:56:22 +0900 Subject: [PATCH] fix(iOS): fix iOS DRM header parser (#3609) --- ios/Video/DataStructures/DRMParams.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/ios/Video/DataStructures/DRMParams.swift b/ios/Video/DataStructures/DRMParams.swift index b0baba49..ce91d4dc 100644 --- a/ios/Video/DataStructures/DRMParams.swift +++ b/ios/Video/DataStructures/DRMParams.swift @@ -25,6 +25,16 @@ struct DRMParams { self.contentId = json["contentId"] as? String self.certificateUrl = json["certificateUrl"] as? String self.base64Certificate = json["base64Certificate"] as? Bool - self.headers = json["headers"] as? [String: Any] + if let headers = json["headers"] as? [[String: Any]] { + var _headers: [String: Any] = [:] + for header in headers { + if let key = header["key"] as? String, let value = header["value"] { + _headers[key] = value + } + } + self.headers = _headers + } else { + self.headers = nil + } } }