mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00

Added an expiration time field to playlists blacklisted to allow Exoplayer to continue playback when playlists that failed were recovered from a bad state. In live environments, some times occur that primary encoder stop working for a while. In that cases, HLS failover mechanism in the player should detect the situation and “switch” to playlists served by the backup encoder (in case a backup encoder exists). This was well managed before these changes. However, and to ensure a playback experience that can recover itself from temporary issues, we cannot blacklist a playlist forever. When streaming live events using HLS, it is quite typical that the player needs to switch from primary to backup playlists, and from backup to primary ones, from time to time to have playback working when temporary issues in the network/encoder are happening. Most of the issues are recoverable, so what I have implemented is a mechanism that makes blacklisted playlist to be available again after a while (60 seconds). Evaluation of this algorithm should happen just when something fails. If player is working with a backup playlist, it shouldn’t switch to the primary one at least something fail.