PLVPictureInPictureManager
Objective-C
@interface PLVPictureInPictureManager : NSObject
#pragma mark - [ 属性 ]
/// avplayer的播放状态
@property (nonatomic, assign, readonly) NSInteger playbackState;
#pragma mark 可配置项
/// 画中画恢复前的用户界面逻辑代理
@property (nonatomic, weak, nullable) id <PLVPictureInPictureRestoreDelegate> restoreDelegate;
/// 画中画小窗是否开启
@property (nonatomic, assign, readonly) BOOL pictureInPictureActive;
/// 画中画当前播放的视频vid
@property (nonatomic, assign, readonly) NSString *currentPlaybackVid;
#pragma mark - [ 方法 ]
/// 单例方法
+ (instancetype)sharedInstance;
/// 停止画中画
- (void)stopPictureInPicture;
/// 设置画中画播放器的播放速率
/// @param rate 速率【0,2】
- (void)setPlaybackRate:(CGFloat)rate;
@end
Swift
class PLVPictureInPictureManager : NSObject
Undocumented
-
avplayer的播放状态
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger playbackState;
Swift
var playbackState: Int { get }
-
画中画恢复前的用户界面逻辑代理
Declaration
Objective-C
@property (nonatomic, weak, nullable) id<PLVPictureInPictureRestoreDelegate> restoreDelegate;
Swift
weak var restoreDelegate: PLVPictureInPictureRestoreDelegate? { get set }
-
画中画小窗是否开启
Declaration
Objective-C
@property (nonatomic, readonly) BOOL pictureInPictureActive;
Swift
var pictureInPictureActive: Bool { get }
-
画中画当前播放的视频vid
Declaration
Objective-C
@property (nonatomic, readonly) NSString *_Nonnull currentPlaybackVid;
Swift
unowned(unsafe) var currentPlaybackVid: NSString { get }
-
单例方法
Declaration
Objective-C
+ (nonnull instancetype)sharedInstance;
Swift
class func sharedInstance() -> Self
-
停止画中画
Declaration
Objective-C
- (void)stopPictureInPicture;
Swift
func stopPictureInPicture()
-
设置画中画播放器的播放速率
Declaration
Objective-C
- (void)setPlaybackRate:(CGFloat)rate;
Swift
func setPlaybackRate(_ rate: Double)
Parameters
rate
速率【0,2】