SRGSSR / srgmediaplayer-apple

An advanced media player library, simple and reliable
MIT License
158 stars 33 forks source link

Incorrect livestream behavior starting with iOS 11.3 #50

Closed defagos closed 5 years ago

defagos commented 6 years ago

Livestreams are not immediately identified as being live starting with iOS 11.3. During an initial period, the stream is namely reported as DVR, and buffering can be observed.

The iOS standard player seems affected as well (but the initial period is very short). The issue can probably be mitigated somehow.

Issue type

Incorrect behavior

Environment information

Reproducibility

Always reproducible

Steps to reproduce

  1. Open the demo on an iOS 11.3 device (or within the simulator).
  2. Play the livestream example.
  3. Observe the slider and user interface behavior.
defagos commented 6 years ago

Same problem with iOS 11.4 beta 1 / Xcode 9.4 beta 1.

defagos commented 6 years ago

This is definitely an iOS 11.3 bug. I opened a detailed radar: http://openradar.appspot.com/radar?id=4970612745306112.

Until Apple fixes this issue, a workaround is to increase the minimumDVRWindowLength value. This of course only makes sense if you play livestreams. To find a sensible value:

  1. Retrieve the m3u8 of a your livestream, then the m3u of one of the qualities.
  2. Calculate the total duration T by adding up all chunk durations in the m3u.
  3. Set the minimumDVRWindowLength value to something slightly larger (e.g. T + 10 seconds).

If you play a variety of playlists with different chunk sizes, compute all associated T values and use the largest one.

defagos commented 6 years ago

Apple engineers have worked on the issue, which seems fixed in iOS 12 beta 1.

defagos commented 5 years ago

Fixed in iOS 12.