|
[TOC]
|
|
[TOC]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# 云直播回放观看端SDK开发指南
|
|
# 云直播回放观看端SDK开发指南
|
|
|
|
|
|
# 1.概述
|
|
# 1.概述
|
... | @@ -382,6 +384,87 @@ Destination 选择 "Frameworks" -> |
... | @@ -382,6 +384,87 @@ Destination 选择 "Frameworks" -> |
|
failed:(initFailedClosure)failed;
|
|
failed:(initFailedClosure)failed;
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
初始化SDK(旧)( 仅 3.x.x 版本可用 )
|
|
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
|
| --------------------------------------- | ------ |
|
|
|
|
| (id)initWithParameter:(PlayParameter *) | 初始化 |
|
|
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
|
|
```objc
|
|
|
|
/**
|
|
|
|
* @brief 进入房间,并请求画图聊天数据并播放视频(可以不登陆,直接从此接口进入直播间)
|
|
|
|
* @param parameter 配置参数信息
|
|
|
|
* 必填参数 userId;
|
|
|
|
* 必填参数 roomId;
|
|
|
|
* 非必填参数 liveid;(已废弃)
|
|
|
|
* 必填参数 viewerName;
|
|
|
|
* 必填参数 token;
|
|
|
|
* 必填参数 docParent;
|
|
|
|
* 必填参数 docFrame;
|
|
|
|
* 必填参数 playerParent;
|
|
|
|
* 必填参数 playerFrame;
|
|
|
|
* 非必填参数 security;
|
|
|
|
* 必填参数 pauseInBackGround;
|
|
|
|
* 必填参数 defaultColor;
|
|
|
|
* 必填参数 PPTScalingMode;
|
|
|
|
* 必填参数 scalingMode;
|
|
|
|
* 非必填参数 playbackCoreType; 默认:PlaybackCoreTypeDefualt
|
|
|
|
*/
|
|
|
|
- (id)initWithParameter:(PlayParameter *)parameter;
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
初始化SDK(新)(仅 4.x.x 版本可用)
|
|
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
|
| ------------------------------------------------- | --------- |
|
|
|
|
| (id)initSDKWithParameter: succed: player: failed: | 初始化SDK |
|
|
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
|
|
```objc
|
|
|
|
/// 初始化SDK
|
|
|
|
/// @param parameter 参数
|
|
|
|
/// @param succed 初始化成功回调
|
|
|
|
/// @param player 播放视图回调
|
|
|
|
/// @param failed 初始化失败回调
|
|
|
|
- (id)initSDKWithParameter:(PlayParameter *)parameter
|
|
|
|
succed:(initSuccedClosure)succed
|
|
|
|
player:(HDSPlayerViewClosure)player
|
|
|
|
failed:(initFailedClosure)failed;
|
|
|
|
```
|
|
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
|
| --------- | ------------------------------------------------------------ |
|
|
|
|
| parameter | 初始化SDK参数,其中 "playerParent","playerFrame" 已废弃删除,新的流视图由 HDSPlayerViewClosure 异步回调,自行处理 |
|
|
|
|
| succed | 初始化SDK成功回调 |
|
|
|
|
| player | 流视图异步回调,存在回调多次;“无延迟直播” 无需关注。 |
|
|
|
|
| failed | 初始化SDK失败回调 |
|
|
|
|
|
|
|
|
流视图(callback回调)
|
|
|
|
|
|
|
|
| 注意 |
|
|
|
|
| ------------------------------------------------------------ |
|
|
|
|
| **“新的流视图”** 通过 初始化SDK(initSDKWithParameter:)方法中的 **player:**,通过 **callback 返回 “流视图”** |
|
|
|
|
| **“流视图”** (属于UIView 类型),所在 **视图区域**,**视图大小** 可根据业务自行调整设置示例代码 |
|
|
|
|
|
|
|
|
```objc
|
|
|
|
_requestDataPlayBack = [[RequestDataPlayBack alloc] initSDKWithParameter:parameter succed:^(BOOL succed) {
|
|
|
|
|
|
|
|
} player:^(UIView * _Nonnull playerView) {
|
|
|
|
--> ** playerView ** 即为视频流视图
|
|
|
|
} failed:^(NSError *error, NSString *reason) {
|
|
|
|
|
|
|
|
}];
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
代理方法
|
|
代理方法
|
|
|
|
|
|
```objc
|
|
```objc
|
... | @@ -541,6 +624,29 @@ typedef NS_ENUM(NSUInteger, HAVE_AUDIO_LINE) { |
... | @@ -541,6 +624,29 @@ typedef NS_ENUM(NSUInteger, HAVE_AUDIO_LINE) { |
|
@property (nonatomic, copy) NSString * _Nullable desc;
|
|
@property (nonatomic, copy) NSString * _Nullable desc;
|
|
```
|
|
```
|
|
|
|
|
|
|
|
设置播放器核心(属性)
|
|
|
|
|
|
|
|
| 参数 | 类型 | 说明 | 所在类 |
|
|
|
|
| ---------------- | ---- | ------------------------------------------------- | --------------------- |
|
|
|
|
| playbackCoreType | Enum | 在线回放播放核心(默认:PlaybackCoreTypeDefualt) | CCSDK/PlayParameter.h |
|
|
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
|
|
```objc
|
|
|
|
/// 在线回放播放器核心
|
|
|
|
typedef NS_ENUM(NSUInteger, PlaybackCoreType) {
|
|
|
|
///使用HDSMedia播放器(默认)
|
|
|
|
PlaybackCoreTypeDefualt,
|
|
|
|
///使用系统AVPlayer播放器
|
|
|
|
PlaybackCoreTypeOrigin,
|
|
|
|
};
|
|
|
|
|
|
|
|
/// 在线回放播放核心(默认:PlaybackCoreTypeDefualt)
|
|
|
|
@property (nonatomic, assign) PlaybackCoreType playbackCoreType;
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
开始配置
|
|
开始配置
|
|
|
|
|
|
```objc
|
|
```objc
|
... | @@ -998,6 +1104,22 @@ typedef NS_ENUM(NSUInteger, HAVE_AUDIO_LINE) { |
... | @@ -998,6 +1104,22 @@ typedef NS_ENUM(NSUInteger, HAVE_AUDIO_LINE) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 回调单个聊天文件数据 (会多次回调)(代理方法)
|
|
|
|
|
|
|
|
| 方法 | 说明 | 所在类 |
|
|
|
|
| ---------------------------- | ----------------------------------- | --------------------------- |
|
|
|
|
| (void)didReceiveChatMessage: | 回调单个聊天文件数据 (会多次回调) | CCSDK/RequestDataPlayBack.h |
|
|
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
|
|
```objc
|
|
|
|
/// 回调单个聊天文件数据 (会多次回调)
|
|
|
|
/// @param chats 聊天数组
|
|
|
|
- (void)didReceiveChatMessage:(NSArray *)chats;
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
## 3.6 问答功能
|
|
## 3.6 问答功能
|
|
|
|
|
|
问答功能的方法回调,相关类RequestDataPlayBack,相关方法如下:
|
|
问答功能的方法回调,相关类RequestDataPlayBack,相关方法如下:
|
... | | ... | |