AVPlayer Video Blank but Hear Sound

前端 未结 3 556
小蘑菇
小蘑菇 2021-01-17 10:33

I\'m switching from MPMoviePlayerController to AVPlayer as I need finer grained control over video swapping. The .mov file I was playi

3条回答
  •  时光说笑
    2021-01-17 10:44

    Found out it was a result of using AutoLayout. In the viewDidLoad the self.playerContainer.bounds is a CGRectZero.

    I had to assign the playerLayer frame in the viewDidAppear to match the playerContainer.

提交回复
热议问题