Skip to content

Instantly share code, notes, and snippets.

@pgpt10
Created February 20, 2019 16:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pgpt10/6ce2ea052a3f1c0d5a20e3687d42c5f5 to your computer and use it in GitHub Desktop.
Save pgpt10/6ce2ea052a3f1c0d5a20e3687d42c5f5 to your computer and use it in GitHub Desktop.
let playerLayer = AVPlayerLayer(player: player)
playerLayer.frame = self.videoView.bounds //bounds of the view in which AVPlayer should be displayed
playerLayer.videoGravity = .resizeAspect
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment