PLVLivePlaybackPlayer
@interface PLVLivePlaybackPlayer : PLVPlayer
直播回放播放器
Note
直播回放播放器 继承自 PLVPlayer.h; 若您希望了解 播放器基础功能 相关属性方法,可查看 PLVPlayer.h; 若您希望了解 直播回放业务 相关属性方法,可查看 PLVLivePlaybackPlayer.h;// 使用演示
PLVLivePlaybackPlayer * livePlaybackPlayer = [[PLVLivePlaybackPlayer alloc] initWithPolyvAccountUserId:accountUserId channelId:channelId vodId:vodId vodList:NO];
livePlaybackPlayer.delegate = self;
livePlaybackPlayer.livePlaybackDelegate = self;
[livePlaybackPlayer setupDisplaySuperview:displaySuperview];
-
直播回放播放器 livePlaybackDelegate
Note
父类 PLVPlayer 的 delegate 也有播放器基础功能的回调,详情可见 PLVPlayer.hDeclaration
Objective-C
@property (nonatomic, weak, readwrite) id<PLVLivePlaybackPlayerDelegate> _Nullable livePlaybackDelegate;Swift
weak var livePlaybackDelegate: PLVLivePlaybackPlayerDelegate? { get set } -
视频解码是否使用“硬解码”
Note
硬解码效率更高,而软解码兼容性更好; YES:使用硬解码 NO:使用软解码; 默认值 YES;Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readwrite) BOOL videoToolBox;Swift
var videoToolBox: Bool { get set } -
后台统计参数数据模型
Note
播放器发送 ViewLog 日志所需要的数据模型,详见 PLVViewLogCustomParam.h 参考可配置的统计参数Declaration
Objective-C
@property (nonatomic, strong, readwrite) PLVViewLogCustomParam *_Nonnull customParam;Swift
var customParam: PLVViewLogCustomParam { get set }
-
频道信息数据模型
Declaration
Objective-C
@property (nonatomic, strong, readonly) PLVChannelInfoModel *_Nonnull channelInfo;Swift
var channelInfo: PLVChannelInfoModel { get } -
已缓存进度
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readonly) CGFloat downloadProgress;Swift
var downloadProgress: CGFloat { get } -
已播放进度
Declaration
Objective-C
@property (nonatomic, assign, unsafe_unretained, readonly) CGFloat playedProgress;Swift
var playedProgress: CGFloat { get } -
已播放时间点字符串 (示例 “01:23”)
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull playedTimeString;Swift
var playedTimeString: String { get } -
总时长字符串 (示例 “01:23”)
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull durationTimeString;Swift
var durationTimeString: String { get } -
直播回放播放器ID
Declaration
Objective-C
@property (nonatomic, copy, readonly) NSString *_Nonnull livePlaybackPlayerId;Swift
var livePlaybackPlayerId: String { get } -
用户观看时长 (单位:秒;播放器暂停则不认为“观看”)
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger watchDuration;Swift
var watchDuration: Int { get } -
用户停留时长 (单位:秒)
Declaration
Objective-C
@property (nonatomic, readonly) NSInteger stayDuration;Swift
var stayDuration: Int { get }
-
创建 直播回放播放器
Note
创建后需调用父类方法 [setupDisplaySuperview:] 进行画面添加,才可正常显示播放内容
Declaration
Objective-C
- (nonnull instancetype)initWithPolyvAccountUserId: (nonnull NSString *)accountUserId channelId:(nonnull NSString *)channelId vodId:(nonnull NSString *)vodId vodList:(BOOL)vodList;Swift
init(polyvAccountUserId accountUserId: String, channelId: String, vodId: String, vodList: Bool)Parameters
accountUserId保利威账户Id
channelId频道号Id
vodId直播回放Id
vodList是否 ‘点播列表’ 视频
-
跳至某个时间点 (单位: 秒)
Declaration
Objective-C
- (void)seekLivePlaybackToTime:(NSTimeInterval)toTime;Swift
func seekLivePlayback(toTime: TimeInterval) -
切换倍速 (范围值 0.0~2.0)
Declaration
Objective-C
- (void)switchLivePlaybackSpeedRate:(CGFloat)toSpeed;Swift
func switchLivePlaybackSpeedRate(_ toSpeed: CGFloat)
View on GitHub
PLVLivePlaybackPlayer Class Reference