Skip to content

Commit 6fea301

Browse files
committed
add new AVMetrics properties
1 parent b0f40bc commit 6fea301

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

Sources/MUXSDKStatsInternal/MuxCore/MUXSDKBandwidthMetricData+AVMetrics.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@ extension MUXSDKBandwidthMetricData {
6262
default:
6363
break
6464
}
65+
66+
#if compiler(>=6.2)
67+
if #available(iOS 26, tvOS 26, visionOS 26, *) {
68+
requestMediaDuration = event.segmentDuration.muxTimeValue
69+
}
70+
#endif
6571
}
6672

6773
convenience init?(event: AVMetricContentKeyRequestEvent) {

Sources/MUXSDKStatsInternal/MuxCore/MUXSDKVideoData.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ extension MUXSDKVideoData {
3535
}
3636
}
3737

38+
#if compiler(>=6.2)
39+
@available(iOS 26, tvOS 26, visionOS 26, *)
40+
func updateWithMediaRendition(_ mediaRendition: AVMetricMediaRendition) {
41+
// videoSourceAdvertisedStableID = mediaRendition.stableID
42+
}
43+
#endif
44+
3845
@available(iOS 15, tvOS 15, *)
3946
static func makeWithRenditionInfo(track: AVAssetTrack, on playerItem: AVPlayerItem) async -> sending Self {
4047
let videoData = Self()

Sources/MUXSDKStatsInternal/Publishers+AVPlayerItem.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ extension AVPlayerItem {
138138

139139
let videoData = MUXSDKVideoData()
140140
videoData.updateWithAssetVariant(metricEvent.toVariant)
141+
#if compiler(>=6.2)
142+
if #available(iOS 26, tvOS 26, visionOS 26, *) {
143+
videoData.updateWithMediaRendition(metricEvent.videoRendition)
144+
}
145+
#endif
141146
muxEvent.videoData = videoData
142147

143148
return muxEvent

0 commit comments

Comments
 (0)