title: How to get video size for HLS stream inside AVPlayer?
body: <p>I am trying to get video resolution when playing hls stream.
  I have typical player init:</p>
  
  <pre><code>let urlAsset = AVURLAsset(URL: currentVideoUrl)
   self.player=AVPlayer(playerItem: AVPlayerItem(asset:urlAsset))
   .......
  </code></pre>
  
  <p>I use KVO and i try to get video size when i get .ReadyToPlay status for AVPlayerItem:</p>
  
  <pre><code>    func resolutionSizeForVideo() {
  
      guard let videoTrack = self.player.currentItem?.asset.tracksWithMediaType(AVMediaTypeVideo).first else
      { return
      }
  
      let size = CGSizeApplyAffineTransform(videoTrack.naturalSize, videoTrack.preferredTransform)
      let frameSize = CGSize(width: fabs(size.width), height: fabs(size.height))
      print ("video size: \(frameSize)")
  
  }
  </code></pre>
  
  <p>The problem is that tracksWithMediaType() always returns empty array (but works for non-stream files, e.g. for .mov).</p>
  
  <p>How can i get size (CGRect) of the HLS video playing inside AVPlayer?</p>