1

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.

noamtm
  • 12,435
  • 15
  • 71
  • 107
  • see this for help : [Accessing URL from AVPlayer object?](https://stackoverflow.com/questions/14035501/accessing-url-from-avplayer-object) – Anbu.Karthik Jul 15 '19 at 07:30
  • 1
    @Anbu.Karthik the answers there suggest exactly what I said **doesn't** work: they look at the URL inside AVPlayer.currentItem.asset. – noamtm Jul 15 '19 at 07:43
  • Made it clearer what doesn't work. – noamtm Jul 15 '19 at 07:47

0 Answers0