-
Notifications
You must be signed in to change notification settings - Fork 476
iOS 14 画中画
changsanjiang edited this page Sep 26, 2020
·
1 revision
-
在控制层中显示 画中画开启按钮. 默认为 YES;
当设备支持画中画时, 设置为 YES 后, 将会在控制层中显示开启按钮. 点击此按钮后进入画中画.
注意: 当在 cell 中播放时, 播放器只有在全屏的情况下, 才会显示此按钮.
_player.defaultEdgeControlLayer.automaticallyShowsPictureInPictureItem = YES;
- 查看当前设备是否支持画中画
[_player.playbackController isPictureInPictureSupported];
- 手动进入画中画
[_player.playbackController startPictureInPicture];
- 手动退出画中画
[_player.playbackController stopPictureInPicture];
- 画中画状态介绍(SJPictureInPictureStatus)
- SJPictureInPictureStatusUnknown: 未进行任何操作的状态
- SJPictureInPictureStatusStarting: 调用了 startPictureInPicture, 正在开启中
- SJPictureInPictureStatusRunning: 已进入画中画
- SJPictureInPictureStatusStopping: 调用了 stopPictureInPicture, 正在退出中
- SJPictureInPictureStatusStopped: 已退出画中画