Feature

Per-Segment Network Timing and CDN Metrics on iOS 18

TL;DR Snapshot

iOS 18's AVMetrics API is now wired into Stream Probe's diagnostics pipeline. Per-segment network timing and CDN info are extracted in Swift, mapped to the shared SegmentMetric model in Kotlin, and delivered through the same diagnostics sink used on Android. The iOS and Android SDKs now capture identical segment-level data.

Share this update

Stream Probe introduces per-segment network timing and CDN metrics for iOS 18 in this update, closing the feature gap between the iOS and Android SDKs.

TL;DR

The iOS SDK now captures the same per-segment diagnostic data as Android. Using iOS 18's AVMetricHLSMediaSegmentRequestEvent, Stream Probe extracts network timing and CDN info for each HLS segment and maps it into the shared SegmentMetric model via Kotlin Multiplatform.

What's New

  • AVMetricsSegmentAdapter (Swift): Extracts value objects from AVMetrics events, including network timing details and CDN metadata per segment
  • AVMetricsSegmentMapper (Kotlin): Maps the extracted iOS 18 AVMetrics data into the common cross-platform SegmentMetric model
  • AVPlayerProbe update: Now consumes AVMetricHLSMediaSegmentRequestEvent on iOS 18 and routes per-segment metrics into the diagnostics sink
  • Segment duration computation: Calculated using transaction-metric Dates from AVMetrics event data
  • iOS/Android parity: Both platforms now populate networkTiming and cdnInfo fields on SegmentMetric

How to Use

No API changes are required. If you're running iOS 18 or later, per-segment metrics now flow automatically through the existing diagnostics pipeline. The SegmentMetric model you already consume will include populated networkTiming and cdnInfo fields.

// AVPlayerProbe picks up AVMetricHLSMediaSegmentRequestEvent automatically on iOS 18+
// Your existing diagnostics sink receives enriched SegmentMetric objects

FAQ

Does this work on iOS versions older than iOS 18?

No. AVMetricHLSMediaSegmentRequestEvent is an iOS 18 API. On earlier versions, the adapter is not invoked and segment metrics behave as before.

Do I need to change how I consume SegmentMetric on the Kotlin side?

No. The mapper populates the existing networkTiming and cdnInfo fields. No model changes, no migration needed.

What CDN information is captured?

The adapter extracts CDN metadata available through the AVMetrics value objects, including host and request-level identifiers surfaced by AVMetricHLSMediaSegmentRequestEvent.

Is this change specific to iOS or does it affect Android too?

iOS only. Android per-segment metrics were already implemented. This update brings iOS up to the same level.