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 + } } }