SRGSSR / srgmediaplayer-apple

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

[Reopen] Playback does not end with truncated Akamai streams when subtitles are displayed #70

Open pyby opened 5 years ago

pyby commented 5 years ago

When playing a truncated Akamai stream with subtitles enabled (truncation via start and end parameters), the subtitles track is correctly aligned at the beginning, but its length is bigger than the stream duration. As a result, the player never reaches the end state.

This issue is similar to #65 .

Issue type

Incorrect behavior

Description of the problem

Subtitles track for truncated streams is an Akamai beta feature. We should report the bug and implement a workaround in the meantime.

Environment information

Reproducibility

Always reproducible

Steps to reproduce

  1. Play an Akamai stream having subtitles, truncated with start and end parameters, for example SRF 10v10 subject of 6 minutes.
  2. Enable subtitles.
  3. Wait until playback reaches the end. The player never ends playback.
pyby commented 5 years ago

The current strategy is to test in the periodic time observer (every 0.1 seconds) if the current time is greater or equal than the duration range.

Unfortunately, the last observed playback time could be near the end of the duration range, but just before. The player goes in a stalled mode.

feature/player-ended proposition is to test when the stalled state is beginning, if the time is at last one second from the end of the duration end or after, set the player to the end state.