层级关系
AVPlayerLayer - AVPlayer - AVPlayerItem - presentationSize
直接取AVPlayerItem对象的presentationSize是不行的,返回的都是0 0
正解:通过监听presentationSize的变化,获取正确的尺寸
1、添加观察者

2、在观察者响应方法里获取尺寸

层级关系
AVPlayerLayer - AVPlayer - AVPlayerItem - presentationSize
直接取AVPlayerItem对象的presentationSize是不行的,返回的都是0 0
正解:通过监听presentationSize的变化,获取正确的尺寸
1、添加观察者
2、在观察者响应方法里获取尺寸
本文标题:获取视频的尺寸
本文链接:https://www.haomeiwen.com/subject/chokwftx.html
网友评论