Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

- Fixed an issue on iOS where the onPlayerStateSync callback was not called from the main thread.

### Added

- Added contentProtection extraction for THEOlive endpoints on iOS.

## [10.9.0] - 26-01-29

### Fixed
Expand Down
57 changes: 54 additions & 3 deletions ios/theolive/THEOplayerRCTTHEOliveEventAdapter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,16 @@ let PROP_ENDPOINT_CONTENT_PROTECTION: String = "contentProtection"
let PROP_REASON_ERROR_CODE: String = "errorCode"
let PROP_REASON_ERROR_MESSAGE: String = "errorMessage"

let PROP_CONTENTPROTECTION_INTEGRATION: String = "integration"
let PROP_CONTENTPROTECTION_FAIRPLAY: String = "fairplay"
let PROP_CONTENTPROTECTION_WIDEVINE: String = "widevine"
let PROP_CONTENTPROTECTION_PLAYREADY: String = "playready"

let PROP_LICENSE_CONFIG_LICENSE_URL: String = "licenseUrl"

let PROP_KEY_SYSTEM_CONFIG_LICENSE_URL: String = "licenseUrl"
let PROP_KEY_SYSTEM_CONFIG_CERTIFICATE_URL: String = "certificateUrl"

class THEOplayerRCTTHEOliveEventAdapter {

#if canImport(THEOplayerTHEOliveIntegration)
Expand All @@ -43,14 +53,55 @@ class THEOplayerRCTTHEOliveEventAdapter {
if let adSrc = endpoint.adSrc {
endpointData[PROP_ENDPOINT_AD_SRC] = adSrc
}
//if let contentProtection = endpoint.contentProtection {
// TODO: not yet available on native iOS SDK.
//}
if let contentProtection = endpoint.channelContentProtection {
endpointData[PROP_ENDPOINT_CONTENT_PROTECTION] = THEOplayerRCTTHEOliveEventAdapter.fromContentProtection(contentProtection: contentProtection)
}
endpointData[PROP_ENDPOINT_WEIGHT] = endpoint.weight
endpointData[PROP_ENDPOINT_PRIORITY] = endpoint.priority
return endpointData
}

class func fromContentProtection(contentProtection: (any THEOplayerTHEOliveIntegration.ChannelContentProtection)?) -> [String:Any] {
guard let contentProtection = contentProtection else {
return [:]
}

var contentProtectionData: [String:Any] = [:]
contentProtectionData[PROP_CONTENTPROTECTION_INTEGRATION] = contentProtection.integration
if let keySystem = contentProtection.fairplay {
contentProtectionData[PROP_CONTENTPROTECTION_FAIRPLAY] = THEOplayerRCTTHEOliveEventAdapter.fromKeySystem(keySystem: keySystem)
}
if let licenseConfiguration = contentProtection.widevine {
contentProtectionData[PROP_CONTENTPROTECTION_WIDEVINE] = THEOplayerRCTTHEOliveEventAdapter.fromLicenseConfiguration(licenseConfiguration: licenseConfiguration)
}
if let licenseConfiguration = contentProtection.playready {
contentProtectionData[PROP_CONTENTPROTECTION_PLAYREADY] = THEOplayerRCTTHEOliveEventAdapter.fromLicenseConfiguration(licenseConfiguration: licenseConfiguration)
}

return contentProtectionData
}

class func fromKeySystem(keySystem: (any THEOplayerTHEOliveIntegration.KeySystemConfiguration)?) -> [String:Any] {
guard let keySystem = keySystem else {
return [:]
}

var keySystemData: [String:Any] = [:]
keySystemData[PROP_KEY_SYSTEM_CONFIG_LICENSE_URL] = keySystem.licenseUrl
keySystemData[PROP_KEY_SYSTEM_CONFIG_CERTIFICATE_URL] = keySystem.certificateUrl
return keySystemData
}

class func fromLicenseConfiguration(licenseConfiguration: (any THEOplayerTHEOliveIntegration.LicenseConfiguration)?) -> [String:Any] {
guard let licenseConfiguration = licenseConfiguration else {
return [:]
}

var licenseConfigurationData: [String:Any] = [:]
licenseConfigurationData[PROP_LICENSE_CONFIG_LICENSE_URL] = licenseConfiguration.licenseUrl
return licenseConfigurationData
}

class func fromReason(reason: THEOplayerSDK.THEOError?) -> [String:Any] {
guard let reason = reason else {
return [:]
Expand Down
14 changes: 7 additions & 7 deletions react-native-theoplayer.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -43,37 +43,37 @@ Pod::Spec.new do |s|

# THEOplayer Dependency
puts "Adding THEOplayerSDK-core"
s.dependency "THEOplayerSDK-core", "~> 10.7"
s.dependency "THEOplayerSDK-core", "~> 10.10"

# THEOlive Dependency
puts "Adding THEOplayer-Integration-THEOlive"
s.dependency "THEOplayer-Integration-THEOlive", "~> 10.7"
s.dependency "THEOplayer-Integration-THEOlive", "~> 10.10"

# Feature based integration dependencies
if theofeatures.include?("GOOGLE_IMA")
puts "Adding THEOplayer-Integration-GoogleIMA"
s.dependency "THEOplayer-Integration-GoogleIMA", "~> 10.7"
s.dependency "THEOplayer-Integration-GoogleIMA", "~> 10.10"
end

if theofeatures.include?("CHROMECAST")
puts "Adding THEOplayer-Integration-GoogleCast"
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 10.7"
s.ios.dependency "THEOplayer-Integration-GoogleCast", "~> 10.10"
end

if theofeatures.include?("THEO_ADS")
puts "Adding THEOplayer-Integration-THEOads"
s.dependency "THEOplayer-Integration-THEOads", "~> 10.7"
s.dependency "THEOplayer-Integration-THEOads", "~> 10.10"
end

if theofeatures.include?("MILLICAST")
puts "Adding THEOplayer-Integration-Millicast"
s.dependency "THEOplayer-Integration-Millicast", "~> 10.7"
s.dependency "THEOplayer-Integration-Millicast", "~> 10.10"
end

# Feature based connector dependencies
if theofeatures.include?("SIDELOADED_TEXTTRACKS")
puts "Adding THEOplayer-Connector-SideloadedSubtitle"
s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 10.7"
s.dependency "THEOplayer-Connector-SideloadedSubtitle", "~> 10.10"
end

end
Loading