PLVLivePlaybackPlayerDelegate

Objective-C

@protocol PLVLivePlaybackPlayerDelegate <NSObject>

@optional
/// 直播回放播放器 发生错误
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param error 错误信息对象 (可能为nil;error.code 可详见 PLVFPlayErrorCodeGenerator.h)
- (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer loadMainPlayerFailureWithError:(NSError * _Nullable)error;

/// 直播回放播放器 需获知外部 ‘当前本地缓存’
///
/// @note 此回调不保证在主线程触发
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param videoId 视频唯一标识,当为暂存时代表fileId,当为回放时代表vid
/// @param channelId 频道号
/// @param listType playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback
///
/// @return PLVPlaybackVideoInfoModel 需返回 ‘当前本地缓存‘ 的数据模型
- (PLVPlaybackLocalVideoInfoModel *)plvLivePlaybackPlayerGetPlaybackCache:(PLVLivePlaybackPlayer *)livePlaybackPlayer videoId:(NSString * _Nullable)videoId channelId:(NSString * _Nullable)channelId listType:(NSString * _Nullable)listType isRecord:(BOOL)isRecord;

/// 直播回放播放器 定时返回当前播放进度
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param downloadProgress 已缓存进度 (0.0 ~ 1.0)
/// @param playedProgress 已播放进度 (0.0 ~ 1.0)
/// @param playedTimeString 当前播放时间点字符串 (示例 "01:23")
/// @param durationTimeString 总时长字符串 (示例 "01:23")
- (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer downloadProgress:(CGFloat)downloadProgress playedProgress:(CGFloat)playedProgress playedTimeString:(NSString *)playedTimeString durationTimeString:(NSString *)durationTimeString;

/// 直播回放播放器 ‘频道信息’ 发生改变
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param channelInfo 当前最新 ’频道信息‘ 对象
- (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer channelInfoDidUpdated:(PLVChannelInfoModel *)channelInfo;

/// 直播回放播放器 ‘视频信息’ 发生改变
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param playbackVideoInfo 当前最新 ’频道信息‘ 对象
- (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer playbackVideoInfoDidUpdated:(PLVPlaybackVideoInfoModel *)playbackVideoInfo;

/// 直播回放播放器 ‘本地视频信息’ 发生改变
///
/// @param livePlaybackPlayer 直播回放播放器
/// @param localPlaybackVideoInfo 当前最新 ’本地频道信息‘ 对象
- (void)plvLivePlaybackPlayer:(PLVLivePlaybackPlayer *)livePlaybackPlayer localPlaybackVideoInfoDidUpdated:(PLVPlaybackLocalVideoInfoModel *)localPlaybackVideoInfo;

@end

Swift

protocol PLVLivePlaybackPlayerDelegate : NSObjectProtocol

Undocumented

  • 直播回放播放器 发生错误

    Declaration

    Objective-C

    - (void)plvLivePlaybackPlayer:
                (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
        loadMainPlayerFailureWithError:(NSError *_Nullable)error;

    Swift

    optional func plvLivePlaybackPlayer(_ livePlaybackPlayer: PLVLivePlaybackPlayer, loadMainPlayerFailureWithError error: Error?)

    Parameters

    livePlaybackPlayer

    直播回放播放器

    error

    错误信息对象 (可能为nil;error.code 可详见 PLVFPlayErrorCodeGenerator.h)

  • 直播回放播放器 需获知外部 ‘当前本地缓存’

    Note

    此回调不保证在主线程触发

    Declaration

    Objective-C

    - (nonnull PLVPlaybackLocalVideoInfoModel *)
        plvLivePlaybackPlayerGetPlaybackCache:
            (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
                                      videoId:(NSString *_Nullable)videoId
                                    channelId:(NSString *_Nullable)channelId
                                     listType:(NSString *_Nullable)listType
                                     isRecord:(BOOL)isRecord;

    Swift

    optional func plvLivePlaybackPlayerGetPlaybackCache(_ livePlaybackPlayer: PLVLivePlaybackPlayer, videoId: String?, channelId: String?, listType: String?, isRecord: Bool) -> PLVPlaybackLocalVideoInfoModel

    Parameters

    livePlaybackPlayer

    直播回放播放器

    videoId

    视频唯一标识,当为暂存时代表fileId,当为回放时代表vid

    channelId

    频道号

    listType

    playback-回放列表,vod-点播列表; 默认普通直播场景为vod,三分屏为playback

    Return Value

    PLVPlaybackVideoInfoModel 需返回 ‘当前本地缓存‘ 的数据模型

  • 直播回放播放器 定时返回当前播放进度

    Declaration

    Objective-C

    - (void)plvLivePlaybackPlayer:
                (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
                 downloadProgress:(CGFloat)downloadProgress
                   playedProgress:(CGFloat)playedProgress
                 playedTimeString:(nonnull NSString *)playedTimeString
               durationTimeString:(nonnull NSString *)durationTimeString;

    Swift

    optional func plvLivePlaybackPlayer(_ livePlaybackPlayer: PLVLivePlaybackPlayer, downloadProgress: CGFloat, playedProgress: CGFloat, playedTime playedTimeString: String, durationTime durationTimeString: String)

    Parameters

    livePlaybackPlayer

    直播回放播放器

    downloadProgress

    已缓存进度 (0.0 ~ 1.0)

    playedProgress

    已播放进度 (0.0 ~ 1.0)

    playedTimeString

    当前播放时间点字符串 (示例 “01:23”)

    durationTimeString

    总时长字符串 (示例 “01:23”)

  • 直播回放播放器 ‘频道信息’ 发生改变

    Declaration

    Objective-C

    - (void)plvLivePlaybackPlayer:
                (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
            channelInfoDidUpdated:(nonnull PLVChannelInfoModel *)channelInfo;

    Swift

    optional func plvLivePlaybackPlayer(_ livePlaybackPlayer: PLVLivePlaybackPlayer, channelInfoDidUpdated channelInfo: PLVChannelInfoModel)

    Parameters

    livePlaybackPlayer

    直播回放播放器

    channelInfo

    当前最新 ’频道信息‘ 对象

  • 直播回放播放器 ‘视频信息’ 发生改变

    Declaration

    Objective-C

    - (void)plvLivePlaybackPlayer:
                (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
        playbackVideoInfoDidUpdated:
            (nonnull PLVPlaybackVideoInfoModel *)playbackVideoInfo;

    Swift

    optional func plvLivePlaybackPlayer(_ livePlaybackPlayer: PLVLivePlaybackPlayer, playbackVideoInfoDidUpdated playbackVideoInfo: PLVPlaybackVideoInfoModel)

    Parameters

    livePlaybackPlayer

    直播回放播放器

    playbackVideoInfo

    当前最新 ’频道信息‘ 对象

  • 直播回放播放器 ‘本地视频信息’ 发生改变

    Declaration

    Objective-C

    - (void)plvLivePlaybackPlayer:
                (nonnull PLVLivePlaybackPlayer *)livePlaybackPlayer
        localPlaybackVideoInfoDidUpdated:
            (nonnull PLVPlaybackLocalVideoInfoModel *)localPlaybackVideoInfo;

    Swift

    optional func plvLivePlaybackPlayer(_ livePlaybackPlayer: PLVLivePlaybackPlayer, localPlaybackVideoInfoDidUpdated localPlaybackVideoInfo: PLVPlaybackLocalVideoInfoModel)

    Parameters

    livePlaybackPlayer

    直播回放播放器

    localPlaybackVideoInfo

    当前最新 ’本地频道信息‘ 对象