Video played with AVPlayer has grey line to top and sides on iPhone 6S Plus

后端 未结 6 751
攒了一身酷
攒了一身酷 2021-01-04 05:02

This seems to be a device specific bug on only iPhone 6S Plus.

Steps:

  1. Download AVPlayer demo sample code
  2. Adjust AVPlaye
6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-04 05:58

    I tried Nate4436271's answer and it worked for me, I mean, had the same issue and got rid of the gray lines, but setting the shouldRasterize property to true, made my video lose image quality. So, I set the videoGravity of my playerLayer to AVLayerVideoGravityResizeAspectFill and I got rid of the lines, while maintaining image quality :)

    Here is what I did:

    playerLayer.videoGravity = AVLayerVideoGravityResizeAspectFill
    

    AspectFill was within my needs and solved the problem. You may wish to evaluate whether other options are better for what you need, like AspectFit or Resize.

    Hope this helps :)

提交回复
热议问题