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
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ extension Ad {
result["c3.ad.firstCreativeId"] = nonEmpty(googleImaAd?.wrapperCreativeIds.first) ?? nonEmpty(googleImaAd?.creativeId) ?? Utilities.defaultStringValue
result["c3.ad.firstAdSystem"] = nonEmpty(googleImaAd?.wrapperAdSystems.first) ?? nonEmpty(googleImaAd?.adSystem) ?? Utilities.defaultStringValue
result["c3.ad.adStitcher"] = Utilities.defaultStringValue
result["c3.ad.position"] = self.adBreak.calculateCurrentAdBreakPosition()
result["c3.ad.position"] = self.adBreak?.calculateCurrentAdBreakPosition() ?? Utilities.defaultStringValue
// linearAd specific
if self.type == THEOplayerSDK.AdType.linear, let duration = self.duration {
result[CIS_SSDK_METADATA_IS_LIVE] = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ struct AdEventForwarder {
player.addRemovableEventListener(type: PlayerEventTypes.PLAYING, listener: filter.conditionalSender(handler.adPlaying)),
player.addRemovableEventListener(type: PlayerEventTypes.TIME_UPDATE) {
filter.conditionalSender(handler.adTimeUpdate)($0.currentTimeInMilliseconds)
filter.conditionalSender(handler.adRenderedFramerateUpdate)(NSNumber(value: Int(player.playerMetrics.renderedFramerate.rounded())))
filter.conditionalSender(handler.adDroppedFramesUpdate)(NSNumber(value: player.playerMetrics.droppedVideoFrames))
filter.conditionalSender(handler.adRenderedFramerateUpdate)(NSNumber(value: Int(player.metrics.renderedFramerate.rounded())))
filter.conditionalSender(handler.adDroppedFramesUpdate)(NSNumber(value: player.metrics.droppedVideoFrames))
},
player.addRemovableEventListener(type: PlayerEventTypes.PAUSE, listener: filter.conditionalSender(handler.adPause))
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ import THEOplayerConnectorUtilities

fileprivate let willEnterForeground = UIApplication.willEnterForegroundNotification
fileprivate let didEnterBackground = UIApplication.didEnterBackgroundNotification
// Xcode 15 (Swift 5.9) introduces (and only fires notification with) `AVPlayerItem.newAccessLogEntryNotification`, and deprecates `Notification.Name.AVPlayerItemNewAccessLogEntry` (doesn't fire notification anymore)
// Older Xcode and Swift versions only fire notification with `Notification.Name.AVPlayerItemNewAccessLogEntry`
// Both `AVPlayerItem.newAccessLogEntryNotification` and `Notification.Name.AVPlayerItemNewAccessLogEntry` are mapped to `Notification.Name("AVPlayerItemNewAccessLogEntry")`, hence we use that.
// Once we drop support for older versions (below Xcode 15 and Swift 5.9) we can switch from `Notification.Name("AVPlayerItemNewAccessLogEntry")` to `AVPlayerItem.newAccessLogEntryNotification`.

class AppEventForwarder {
private let center = NotificationCenter.default
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ class PlayerEventForwarder {
player.addRemovableEventListener(type: PlayerEventTypes.TIME_UPDATE) {
handler.timeUpdate(
currentTimeInMilliseconds: $0.currentTimeInMilliseconds,
renderedFramerate: NSNumber(value: Int(player.playerMetrics.renderedFramerate.rounded())),
droppedFrames: NSNumber(value: player.playerMetrics.droppedVideoFrames)
renderedFramerate: NSNumber(value: Int(player.metrics.renderedFramerate.rounded())),
droppedFrames: NSNumber(value: player.metrics.droppedVideoFrames)
)
},
player.addRemovableEventListener(type: PlayerEventTypes.SOURCE_CHANGE) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public class AdEventReporter: AdEventProcessor {
nielsen.stop()
nielsen.loadMetadata(
[
"type": ad.adBreak.nielsenType,
"type": ad.adBreak?.nielsenType,
"assetid": ad.id
]
)
Expand Down
Loading