Skip to content

Commit 6f0b42b

Browse files
committed
add new AVMetrics properties
1 parent 6360cf9 commit 6f0b42b

File tree

3 files changed

+16
-0
lines changed

3 files changed

+16
-0
lines changed

Sources/MUXSDKStatsInternal/MuxCore/MUXSDKBandwidthMetricData+AVMetrics.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ extension MUXSDKBandwidthMetricData {
6868
default:
6969
break
7070
}
71+
72+
#if compiler(>=6.2)
73+
requestMediaDuration = event.segmentDuration.muxTimeValue
74+
#endif
7175
}
7276

7377
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+
videoSourceAdvertisedRenditionName = 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)