I'm developing iOS app which uses HLS. In our video platform we use Nginx proxy_pass module for redirecting from one origin to another when one of them becomes unavailable (at all we have 2 origins). Switching between origins is transparent for client, it's maintained by balancer, for client playlist URI stays unchanged.
We faced a problem with AVPlayer with such switching workflow wich also appear in QuickTime. According to network log next things happens:
At the moment of switching AVPlayer asks for live playlist again and when it finishes playing chunks loaded before switching it starts to play not the next chunk in playlist but the first! And there no change in AVPlayer currentTime property, it continues to change like there was no switching on the first chunk (in normal seeking at the start of playlist currentTime will be 0), no player item status changes happen, no notifications are thrown, nothing special in access log, error log is empty at all. So we can't update user interface (i.e. seek bar) and alter user that he was redirected to another time of live streeam. And the problem is even worse in context that we should not show user the live stream out of bounds of particular broadcast.
Any suggestions how to solve this? Or it's core AVPlayer bug (as far as this issue also appear in Quicktime)?