14

With MPMoviePlayerControllers's, scaling a movie is easy with setting MPMovieScalingMode. (like MPMovieScalingModeFill, MPMovieScalingModeAspectFill)

With AVPlayer/AVPlayerLayer I can't seem to find anything like that. Do I have to do this myself? If so, how do I start on this?

steipete
  • 7,581
  • 5
  • 47
  • 81

2 Answers2

29

Take a look at videoGravity property in AVPlayerLayer, looks like it is what you need.

Vladimir
  • 170,431
  • 36
  • 387
  • 313
9

For some users, you can use videoGravity like this :

playerViewController.videoGravity = AVLayerVideoGravityResizeAspectFill

also :

  • AVLayerVideoGravityResizeAspect
  • AVLayerVideoGravityResizeAspectFill
  • AVLayerVideoGravityResize
iOS.Lover
  • 5,923
  • 21
  • 90
  • 162