Sometimes when playing a video in AVPlayer, the original URL (the one passed to AVPlayer(url:)
or to AVURLAsset(url:)
) redirects to the actual URL.
For example:
https://example.com/video/latest.m3u8
=>
https://example.com/video/123456.m3u8
AVPlayer automatically follows the redirect, which is great; but how can I get the final URL?
I checked, and the URL inside AVPlayer.currentItem.asset
is the original one.