AVPlayer on left side of cell works perfectly. AVPlayer on right side of cell does not work

点点圈 提交于 2019-12-06 15:43:33

I have figured out my problem. And in true idiot fashion, it was a very, very simple fix :)

In the playVideoOnRightFromCache function, I just need to change this line:

videoCell.playerLayer2.frame = CGRectMake((videoCell.frame.size.width / 2), 0, (videoCell.frame.size.width / 2), 255);

to this:

videoCell.playerLayer2.frame = CGRectMake(0, 0, (videoCell.frame.size.width / 2), 255);

The problem is that the sublayer I was adding it to already started at halfway across the screen. So when I made the x origin of the playerLayer2 frame to be the value of (videoCell.frame.size.width / 2), I was actually making the playerLayer2 origin start OFF the side of the screen, therefore not visible.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!