aslanyanhaik / youtube-iOS

youtube iOS app template written in swift 5

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AVPlayerLayer frame doesn't fit into UIView for video player

tobitech opened this issue · comments

Hello!. I'm trying to replicate this in my app I got the minimising feature right but couldn't get AVPlayerPlayer to fit into the UIView for a video player in my code, I have set this playerLayer.frame = self.videoPlayerView.frame self.videoPlayerView.layer.addSublayer(playerLayer) but it still not inside of it. Where in the code could I be getting it wrong? It's just a thin rect at the middle of the screen as shown in the screenshot.
screen shot 2016-10-21 at 10 10 59 am

Okay I found a way to fix it using Apple's documentation of AVPlayerLayer.