If the HLS playlist source URL returns a 301 (moved permanently) HTTP code, the AVPlayer doesn't update the URL after exiting the AirPlay.
Example: http://example.com/old/playlist.m3u8 > 301 to http://example.com/new/something.m3u8
Everything works fine until we tap the Apple TV in the AirPlay options and then tap the iPhone in order to exit the AirPlay.
The player should query: http://example.com/old/playlist.m3u8 > 301 to http://example.com/new/something.m3u8
The player is querying: http://example.com/old/something.m3u8 Which returns a Bad Request.
Problem occurs on the iOS 16 beta 5, on the iOS 15 everything works as expected.