How can I understand errors in HLS playback

Generated on 7/31/2024

1 search

To understand errors in HLS playback, you can utilize the enhanced media performance metrics available in iOS 18. These metrics are represented as events and can be accessed through various logs and notifications. Here are some key points to help you understand and diagnose errors:

  1. Access Logs and Error Logs: You can obtain client-side metrics via access logs, error logs, and various AV player notifications. These logs provide insights into the playback session and help in triaging issues.

  2. Playback Timeline: By examining the playback timeline, you can identify events such as fetching the multivariate playlist, video, audio, and subtitle playlists. For example, if playback takes too long to start, you can look at the startup events to see if there were delays in fetching content keys or other resources.

  3. Stall Events: If playback stalls, you can zoom into the timeline to see what happened just before the stall. For instance, a stall might occur if the video media segment returns an HTTP 404 error, causing the AV player to run out of buffer.

  4. NSURLErrorSessionTaskMetrics: This can provide additional details on why a request failed, such as the complete set of response headers and other network transaction details. This information can be used to narrow down issues when working with CDN partners.

  5. Summary Events: At the end of a playback session, AV player creates a summary event that provides key performance indicators (KPIs) such as the total switch count for the session. These KPIs help monitor media playback health at scale.

For a detailed exploration of these metrics and how to use them, you can refer to the session Discover media performance metrics in AVFoundation.

Relevant Sessions

These sessions provide comprehensive insights into handling HLS playback issues and enhancing ad experiences with HLS interstitials.