Skip to content
Open
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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- Conviva
- Report AdTagPArameters to Conviva for THEOads sources.

### Fixed

- Conviva
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

import ConvivaSDK
import THEOplayerSDK
#if canImport(THEOplayerTHEOadsIntegration)
import THEOplayerTHEOadsIntegration
#endif

class BasicEventConvivaReporter {

Expand Down Expand Up @@ -84,13 +87,21 @@ class BasicEventConvivaReporter {
if let source = event.source, let url = selectedSource {
newSource = .init(description: source, url: url)
let assetName = source.metadata?.title ?? Utilities.defaultStringValue;
let contentInfo = [
var contentInfo = [
CIS_SSDK_METADATA_PLAYER_NAME: Utilities.playerName,
CIS_SSDK_METADATA_STREAM_URL: url,
CIS_SSDK_METADATA_ASSET_NAME: assetName,
CIS_SSDK_METADATA_IS_LIVE: NSNumber(value: false),
CIS_SSDK_METADATA_DURATION: NSNumber(value: -1)
] as [String: Any]

// THEOads adTagParameters
if let adTagParams = self.theoAdsAdTagParams(source: newSource?.description) {
adTagParams.forEach { (key, value) in
contentInfo["theoAdsTag_\(key)"] = value
}
}

self.videoAnalytics.setContentInfo(contentInfo)
self.storage.storeKeyValuePair(key: CIS_SSDK_METADATA_ASSET_NAME, value: assetName)
self.storage.storeKeyValuePair(key: CIS_SSDK_METADATA_STREAM_URL, value: url)
Expand All @@ -103,6 +114,20 @@ class BasicEventConvivaReporter {
self.currentSession.source = newSource
}

private func theoAdsAdTagParams(source: SourceDescription?) -> [String:String]? {
#if canImport(THEOplayerTHEOadsIntegration)
if let currentSource = source,
let ads = currentSource.ads,
let theoAdsDescription = ads.first(where: {
$0.integration == .theoAds && $0 is THEOAdDescription
}) as? THEOAdDescription,
let foundParams = theoAdsDescription.adTagParameters {
return foundParams
}
#endif
return [:]
}

func renderedFramerateUpdate(framerate: Float) {
self.videoAnalytics.reportPlaybackMetric(CIS_SSDK_PLAYBACK_METRIC_RENDERED_FRAMERATE, value: NSNumber(value: Int(framerate.rounded())))
}
Expand Down
3 changes: 3 additions & 0 deletions THEOplayer-Connector-Conviva.podspec
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,7 @@ Pod::Spec.new do |s|
s.dependency 'ConvivaSDK', '4.0.51'
s.dependency 'THEOplayerSDK-core', "~> 8"
s.dependency 'THEOplayer-Connector-Utilities', "~> " + theoplayer_connector_major_minor_version, ">= " + theoplayer_connector_version

# THEOads AdTagParameter reporting
s.ios.dependency "THEOplayer-Integration-THEOads", "~> 8.11"
end