|
|
# 云直播 iOS 观看端 4.0.0 SDK升级文档
|
|
|
|
|
|
[TOC]
|
|
|
|
|
|
## ※※ 特别注意 ※※
|
|
|
|
|
|
### 注意事项
|
|
|
|
|
|
| 注意事项 |
|
|
|
| ---------------------------------------- |
|
|
|
| 1. 支持最低iOS版本为 iOS 10.0。 |
|
|
|
| 2. 连麦功能支持 “ 多人连麦 ”。 |
|
|
|
| 3. SDK内调整多个API,多数API需重新对接。 |
|
|
|
|
|
|
|
|
|
|
|
|
### 新增依赖库
|
|
|
|
|
|
| 新增依赖库 | 类型 |
|
|
|
| -------------------------- | ---------- |
|
|
|
| alivcffmpeg.framework | 动态库 |
|
|
|
| AliyunPlayer.framework | 动态库 |
|
|
|
| artcSource.framework | 动态库 |
|
|
|
| artpSource.framework | 动态库 |
|
|
|
| CCBarleyLibrary.framework | 动态库 |
|
|
|
| CCClassRoomBasic.framework | 动态库 |
|
|
|
| CCFuncTool.framework | 动态库 |
|
|
|
| CCIMLib.framework | 动态库 |
|
|
|
| CCStreamLib.framework | 动态库 |
|
|
|
| MQTTClient.framework | 动态库 |
|
|
|
| RtsSDK.framework | 动态库 |
|
|
|
| ZegoLiveRoom.framework | 动态库 |
|
|
|
| libbz2.tbd | 系统动态库 |
|
|
|
|
|
|
|
|
|
|
|
|
### 集成方式
|
|
|
|
|
|
#### cocoapods 集成云直播 (推荐)
|
|
|
|
|
|
**必须** 需在 Podfile 文件中添加以下代码
|
|
|
|
|
|
```
|
|
|
pod 'CCLivePlaySDK'
|
|
|
pod 'HDVideoClass_BSDK'
|
|
|
pod 'HDSSZip'
|
|
|
pod 'AgoraRtcEngine_iOS', '3.4.8'
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 本地 集成云直播
|
|
|
|
|
|
**必须依赖的库**
|
|
|
|
|
|
```
|
|
|
alivcffmpeg.framework
|
|
|
AliyunPlayer.framework
|
|
|
artcSource.framework
|
|
|
artpSource.framework
|
|
|
CCBarleyLibrary.framework
|
|
|
CCClassRoomBasic.framework
|
|
|
CCFuncTool.framework
|
|
|
CCIMLib.framework
|
|
|
CCStreamLib.framework
|
|
|
MQTTClient.framework
|
|
|
RtsSDK.framework
|
|
|
ZegoLiveRoom.framework
|
|
|
CCSDK.framework
|
|
|
HDBaseUtils.framework
|
|
|
HDMediaFramework.framework
|
|
|
WebRTC.framework
|
|
|
CCBundle.bundle
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
## 4.0.0
|
|
|
|
|
|
发版日期:2022.01.19
|
|
|
|
|
|
### 更新目录
|
|
|
|
|
|
| 模块 | 功能变更 | 涉及类 |
|
|
|
| -------------------- | -------------- | ---------------------------------- |
|
|
|
| 直播(Live) | 初始化SDK | PlayParameter,RequestData |
|
|
|
| | 播放器 | PlayParameter,RequestData |
|
|
|
| | 连麦 | PlayParameter,RequestData |
|
|
|
| | 红包雨(新增) | PlayParameter,RequestData |
|
|
|
| | | |
|
|
|
| 在线回放(Playback) | 初始化SDK | PlayParameter,RequestDataPlayBack |
|
|
|
| | 播放器 | PlayParameter,RequestDataPlayBack |
|
|
|
| | | |
|
|
|
| 离线回放(Offline) | 初始化SDK | PlayParameter,OfflinePlayBack |
|
|
|
| | 播放器 | PlayParameter,OfflinePlayBack |
|
|
|
|
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
### 直播(Live)
|
|
|
|
|
|
#### 初始化SDK(主动方法)
|
|
|
|
|
|
##### 初始化SDK(新)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------- | --------- |
|
|
|
| (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失败回调 |
|
|
|
|
|
|
##### ~~初始化SDK(旧)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ----------------------- |
|
|
|
| ~~(id)initWithParameter:~~ | ~~初始化SDK(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 进入房间,并请求画图聊天数据并播放视频(可以不登陆,直接从此接口进入直播间)(已删除)
|
|
|
* @param parameter 配置参数信息
|
|
|
* 必填参数 userId; //用户ID
|
|
|
* 必填参数 roomId; //房间ID
|
|
|
* 必填参数 viewerName; //用户名称
|
|
|
* 必填参数 token; //房间密码
|
|
|
* 必填参数 docParent; //文档父类窗口
|
|
|
* 必填参数 docFrame; //文档区域
|
|
|
* 必填参数 playerParent; //视频父类窗口
|
|
|
* 必填参数 playerFrame; //视频区域
|
|
|
* 必填参数 scalingMode; //屏幕适配方式
|
|
|
* 必填参数 defaultColor; //ppt默认底色,不写默认为白色
|
|
|
* 必填参数 PPTScalingMode; //PPT适配方式
|
|
|
PPT适配模式分为四种,
|
|
|
1.拉伸填充,PPT内容全部展示在显示区域,会被拉伸或压缩,不会存在黑边
|
|
|
2.等比居中,PPT内容保持原始比例,适应窗口展示在显示区域,会存在黑边
|
|
|
3.等比填充,PPT内容保持原始比例,以横向或纵向适应显示区域,另一方向将会超出显示区域,超出部分会被裁减,不会存在黑边
|
|
|
4.根据直播间文档显示模式的返回值进行设置(推荐)
|
|
|
* 必填参数 pauseInBackGround; //后台是否继续播放,
|
|
|
* 注意:如果开启后台播放需要打开 xcode->Capabilities->Background Modes->on->Audio,AirPlay,and Picture in Picture
|
|
|
* (选填参数)viewercustomua; //用户自定义参数,需和后台协商,没有定制传@""
|
|
|
*/
|
|
|
- (id)initWithParameter:(PlayParameter *)parameter;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 错误回调(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------- | -------- |
|
|
|
| (void)onError: | 错误回调 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 3.18.0 new 错误回调
|
|
|
/// @param model 错误信息
|
|
|
- (void)onError:(HDSOnErrorModel *)model;
|
|
|
|
|
|
@interface HDSOnErrorModel : NSObject
|
|
|
@property (nonatomic, assign) OnErrorType type;
|
|
|
@property (nonatomic, copy) NSString * _Nullable message;
|
|
|
@end
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, OnErrorType) {
|
|
|
OnErrorType_LoginFailed = 2001001001, // 登陆失败
|
|
|
OnErrorType_GetPlaySourceFailed = 2001001002, // 获取播放源失败
|
|
|
OnErrorType_GetSummaryFailed = 2001001003, // 获取摘要失败
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 播放器
|
|
|
|
|
|
##### 流视图(callback回调)
|
|
|
|
|
|
| 注意 |
|
|
|
| ------------------------------------------------------------ |
|
|
|
| **“新的流视图”** 通过 初始化SDK(initSDKWithParameter:)方法中的 **player:**,通过 **callback 返回 “流视图”** |
|
|
|
| **“流视图”** (属于UIView 类型),所在 **视图区域**,**视图大小** 可根据业务自行调整设置 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
_requestData = [[RequestData alloc] initSDKWithParameter:parameter succed:^(BOOL succed) {
|
|
|
|
|
|
} player:^(UIView * _Nonnull playerView) {
|
|
|
--> ** playerView ** 即为视频流视图
|
|
|
} failed:^(NSError *error, NSString *reason) {
|
|
|
|
|
|
}];
|
|
|
```
|
|
|
|
|
|
##### ~~播放器实例~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | -------------------- |
|
|
|
| ~~ijkPlayer~~ | ~~播放器(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器 (已删除)
|
|
|
*/
|
|
|
@property (retain, atomic) HDFFMoviePlayerController *ijkPlayer;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器frame~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------ | ----------------------------- |
|
|
|
| ~~(void)changePlayerFrame:(CGRect) playerFrame~~ | ~~改变播放器frame(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器frame (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerFrame:(CGRect) playerFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器父窗口~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------- | ------------------------------ |
|
|
|
| ~~(void)changePlayerParent:~~ | ~~改变播放器父窗口(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器父窗口 (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerParent:(UIView *) playerParent;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流加载状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | -------------- |
|
|
|
| (HDSMediaLoadState)getMediaLoadStatus | 获取流加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流加载状态
|
|
|
- (HDSMediaLoadState)getMediaLoadStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaLoadState](#divtop4)
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流播放状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | -------------- |
|
|
|
| (HDSMediaPlaybackState)getMediaPlayStatus | 获取流播放状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流播放状态
|
|
|
- (HDSMediaPlaybackState)getMediaPlayStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaPlaybackState](#divtop5)
|
|
|
|
|
|
|
|
|
|
|
|
##### 播放器准备完成(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------------- | --------------------------- |
|
|
|
| (void)HDMediaPlaybackIsPreparedToPlayDidChange | 播放器准备完成 (会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------------------- | -------------------------- |
|
|
|
| ~~(void)HDMediaPlaybackIsPreparedToPlayDidChange:~~ | 播放器准备完成(会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)(已变更)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange:(NSDictionary *)dict;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频状态改变(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------- | ------------ |
|
|
|
| (void)HDSMediaPlayBackStateDidChange: | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变
|
|
|
* @param state
|
|
|
* HDSMediaPlaybackStateStopped 播放停止
|
|
|
* HDSMediaPlaybackStatePlaying 开始播放
|
|
|
* HDSMediaPlaybackStatePaused 暂停播放
|
|
|
* HDSMediaPlaybackStateInterrupted 播放间断
|
|
|
* HDSMediaPlaybackStateSeekingForward 播放快进
|
|
|
* HDSMeidaPlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDSMediaPlayBackStateDidChange:(HDSMeidaPlaybackState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | ------------ |
|
|
|
| ~~(void)HDMoviePlayBackStateDidChange:~~ | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变(已变更)
|
|
|
* @param state
|
|
|
* HDMoviePlaybackStateStopped 播放停止
|
|
|
* HDMoviePlaybackStatePlaying 开始播放
|
|
|
* HDMoviePlaybackStatePaused 暂停播放
|
|
|
* HDMoviePlaybackStateInterrupted 播放间断
|
|
|
* HDMoviePlaybackStateSeekingForward 播放快进
|
|
|
* HDMoviePlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDMoviePlayBackStateDidChange:(HDMoviePlaybackState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频加载状态(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | ------------ |
|
|
|
| (void)HDSMediaLoadStateDidChange: | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态
|
|
|
* @param state 播放状态
|
|
|
* HDSMediaLoadStateUnknown 未知状态
|
|
|
* HDSMediaLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDSMediaLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDSMediaLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDSMediaLoadStateDidChange:(HDSMediaLoadState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | ------------ |
|
|
|
| ~~(void)HDMovieLoadStateDidChange:~~ | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态(已变更)
|
|
|
* @param state 播放状态
|
|
|
* HDMovieLoadStateUnknown 未知状态
|
|
|
* HDMovieLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDMovieLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDMovieLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDMovieLoadStateDidChange:(HDMovieLoadState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~切换线路~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------------------- | ----------------------- |
|
|
|
| ~~(void)changeLineWithQuality: Stream: completion:~~ | ~~切换线路 (已删除)~~ |
|
|
|
|
|
|
示例代码:
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 切换线路 监听HDReceivedVideoAudioLinesWithModel代理获取线路/清晰度等信息 (已删除)
|
|
|
* @param quality 清晰度 0-原画;200-流畅;300-标清;音频传空字符串
|
|
|
* @param stream 线路 从0开始,如两条线路则传0或1
|
|
|
* results { //切换结果
|
|
|
* success 0 切换成功 -1切换失败 -2 切换频繁
|
|
|
* reason 错误原因
|
|
|
* }
|
|
|
* 废弃版本 3.14.0
|
|
|
* 兼容版本 2021年11月08日之后将不再维护
|
|
|
* 新方法 切换播放器类型 - (void)changePlayMode:(PLAY_MODE_TYEP)mode;
|
|
|
* 切换清晰度 - (void)changeQuality:(NSString *)quality completion:(void (^)(NSDictionary * results))completion;
|
|
|
* 切换线路 - (void)changeLine:(NSInteger)index completion:(void (^)(NSDictionary * results))completion;
|
|
|
*/
|
|
|
- (void)changeLineWithQuality:(NSString *)quality Stream:(NSInteger)stream completion:(void (^)(NSDictionary * results))completion;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~房间的音视频线路~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------------- | ----------------------------- |
|
|
|
| ~~(void)HDReceivedVideoAudioLinesWithModel:~~ | ~~房间的音视频线路 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 房间的音视频线路 (已删除)
|
|
|
* @param model LineModel 详情
|
|
|
*
|
|
|
* 废弃版本 3.14.0
|
|
|
* 兼容版本 2021年11月08日之后将不再维护
|
|
|
* 新方法 清晰度回调 - (void)HDReceivedVideoQuality:(NSDictionary*)dict;
|
|
|
* 线路回调 - (void)HDReceivedVideoAudio:(NSDictionary *)dict;
|
|
|
*/
|
|
|
- (void)HDReceivedVideoAudioLinesWithModel:(LineModel *)model;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 连麦
|
|
|
|
|
|
##### 房间连麦信息
|
|
|
|
|
|
###### 房间连麦状态(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | ---------------- |
|
|
|
| (void)onMediaCallStatusDidChange: | 房间是否允许连麦 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 房间是否允许连麦
|
|
|
/// @param callInfo 房间信息
|
|
|
- (void)onMediaCallStatusDidChange:(HDSRoomCallInfo *)callInfo;
|
|
|
```
|
|
|
|
|
|
HDSRoomCallInfo
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| --------------------- | ------------------------------------------------------------ |
|
|
|
| isMultiMediaCallRoom | 是否是多人连麦房间( YES 多人连麦 / NO 单人连麦 ) |
|
|
|
| isMediaCallFuncEnable | 是否开启连麦功能 ( YES 房间连麦功能开启 / NO 房间连麦功能未开启 ) |
|
|
|
| disableReason | 房间连麦功能未开启原因 |
|
|
|
| roomCallType | 连麦类型 ( HDSRoomCallType ) |
|
|
|
|
|
|
```objc
|
|
|
typedef NS_ENUM(NSInteger, HDSRoomCallType) {
|
|
|
HDSRoomCallTypeAudio, /// 音频连麦房间 (多人连麦情况下只能申请音频连麦)
|
|
|
HDSRoomCallTypeAudioVideo, /// 视频连麦房间 (单人连麦可申请音频或视频连麦)
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### 连麦模式切换(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------- | ---------------------------------- |
|
|
|
| (void)onMediaCallModeDidChange: | 连麦模式切换 只有多人连麦才会触发 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 连麦模式切换 只有多人连麦才会触发
|
|
|
/// @param mode 模式 7 无延迟 / 8 低延迟 / 9 普通
|
|
|
- (void)onMediaCallModeDidChange:(int)mode;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 主动发起上麦操作
|
|
|
|
|
|
###### 主动申请上麦(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------------------- | ------------ |
|
|
|
| (void)callInPreviewWithType: succed: failed: | 主动申请上麦 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 主动申请上麦
|
|
|
/// @param type 类型
|
|
|
/// @param succedClosure 成功回调 (preview 为自己的预览视图,仅在多人连麦使用)
|
|
|
/// @param failedClosure 失败回调
|
|
|
- (void)callInPreviewWithType:(HDSMediaCallType)type
|
|
|
succed:(void(^)(UIView *preview))succedClosure
|
|
|
failed:(void(^)(HDSMediaCallError error))failedClosure;
|
|
|
```
|
|
|
|
|
|
| 参数 | | 注释 |
|
|
|
| ------------- | -------------------------- | -------------- |
|
|
|
| type | HDSMediaCallTypeAudio | 音频连麦 |
|
|
|
| | HDSMediaCallTypeAudioVideo | 视频连麦 |
|
|
|
| succedClosure | preview | 本人的预览视图 |
|
|
|
| failedClosure | error | 连麦错误信息 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 主动挂断(下课也需要调用)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | -------- |
|
|
|
| (void)hangup: | 主动挂断 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 挂断
|
|
|
/// @param closure 回调
|
|
|
/// 主动挂断连麦,用户主动点击下麦按钮时需要关心finishClosure的返回值,
|
|
|
/// 退出直播间、下课等调用hangup时不需要关心callback
|
|
|
- (void)hangup:(hangupClosure)closure;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------- | -------- |
|
|
|
| closure | 挂断回调 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 被挂断(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------- | ------ |
|
|
|
| (void)onCallWasHangup | 被挂断 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 被挂断
|
|
|
- (void)onCallWasHangup;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 被邀请上麦操作
|
|
|
|
|
|
###### 被邀请上麦(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------ | -------- |
|
|
|
| (void)onInviteCall | 邀请上麦 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 邀请上麦
|
|
|
- (void)onInviteCall;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### 同意邀请(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | -------- |
|
|
|
| (void)agreeCallInPreview: failed: | 同意上麦 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 同意上麦
|
|
|
/// @param succedClosure 成功回调 (preview 为自己的预览视图,仅在多人连麦使用)
|
|
|
/// @param failedClosure 失败回调
|
|
|
- (void)agreeCallInPreview:(void(^)(UIView *preview))succedClosure
|
|
|
failed:(void(^)(HDSMediaCallError error))failedClosure;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------------- | ----------------------------------------------------- |
|
|
|
| succedClosure | 成功回调 (preview 为自己的预览视图,仅在多人连麦使用) |
|
|
|
| failedClosure | 失败回调 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 邀请被取消(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------- | ---------- |
|
|
|
| (void)onInviteCanceled | 邀请被取消 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 邀请被取消
|
|
|
- (void)onInviteCanceled;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### 拒绝邀请(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------- | -------- |
|
|
|
| (void)rejectCall | 拒接邀请 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 拒接邀请
|
|
|
- (void)rejectCall;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 远端流相关操作
|
|
|
|
|
|
###### 远端流可用(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------- | ---------- |
|
|
|
| (void)onRemoteStreamEnable: | 远端流可用 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 远端流可用
|
|
|
/// @param streamModel 流信息
|
|
|
- (void)onRemoteStreamEnable:(HDSStreamModel *)streamModel;
|
|
|
```
|
|
|
|
|
|
HDSStreamModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------- | ----------------------------------- |
|
|
|
| hds_remoteView | 远端流视图 |
|
|
|
| userInfo | 用户信息 (HDSStreamUserInfoModel) |
|
|
|
|
|
|
HDSStreamUserInfoModel
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | --------------------- |
|
|
|
| userId | 用户ID |
|
|
|
| userName | 用户名 |
|
|
|
| userRole | 用户角色 (0 :老师) |
|
|
|
| isAudioEnable | 声音是否可用 |
|
|
|
| isVideoEnable | 视频是否可用 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 拉远端流(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------- | -------- |
|
|
|
| (void)pullRemoteStream: succed: failed: | 拉远端流 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 拉远端流
|
|
|
/// @param userId 用户ID
|
|
|
/// @param succedClosure 成功
|
|
|
/// @param failedClosure 失败
|
|
|
- (void)pullRemoteStream:(NSString *)userId
|
|
|
succed:(pullStreamSuccedClosure)succedClosure
|
|
|
failed:(pullStreamFailedClosure)failedClosure;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------------- | -------------------------- |
|
|
|
| userId | 用户ID |
|
|
|
| succedClosure | 成功回调(HDSStreamModel) |
|
|
|
| failedClosure | 错误回调 |
|
|
|
|
|
|
HDSStreamModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------- | ----------------------------------- |
|
|
|
| hds_remoteView | 远端流视图 |
|
|
|
| userInfo | 用户信息 (HDSStreamUserInfoModel) |
|
|
|
|
|
|
HDSStreamUserInfoModel
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | --------------------- |
|
|
|
| userId | 用户ID |
|
|
|
| userName | 用户名 |
|
|
|
| userRole | 用户角色 (0 :老师) |
|
|
|
| isAudioEnable | 声音是否可用 |
|
|
|
| isVideoEnable | 视频是否可用 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 远端流不可用(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------- | ------------ |
|
|
|
| (void)onRemoteStreamDisable: | 远端流不可用 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 远端流不可用
|
|
|
/// @param streamModel 流信息
|
|
|
- (void)onRemoteStreamDisable:(HDSStreamModel *)streamModel;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ----------- | ------ |
|
|
|
| streamModel | 流信息 |
|
|
|
|
|
|
HDSStreamModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------- | ----------------------------------- |
|
|
|
| hds_remoteView | 远端流视图 |
|
|
|
| userInfo | 用户信息 (HDSStreamUserInfoModel) |
|
|
|
|
|
|
HDSStreamUserInfoModel
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | --------------------- |
|
|
|
| userId | 用户ID |
|
|
|
| userName | 用户名 |
|
|
|
| userRole | 用户角色 (0 :老师) |
|
|
|
| isAudioEnable | 声音是否可用 |
|
|
|
| isVideoEnable | 视频是否可用 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 移除远端流(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------- | ---------- |
|
|
|
| (void)removeRemoteStream: | 移除远端流 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 移除远端流
|
|
|
/// @param userId 远端流用户id
|
|
|
- (void)removeRemoteStream:(NSString *)userId;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------ | -------------------- |
|
|
|
| userId | 远端流不可用的用户ID |
|
|
|
|
|
|
|
|
|
|
|
|
##### 连麦中相关操作
|
|
|
|
|
|
###### 设置本地视频开启 (开始直播之后生效)(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ----------------------------------- |
|
|
|
| (BOOL)setLocalVideoEnable: | 设置本地视频开启 (开始直播之后生效) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 设置本地视频开启 (开始直播之后生效)
|
|
|
/// @param enable 是否开启 YES 开启/ NO 关闭
|
|
|
/// @return 是否操作成功
|
|
|
- (BOOL)setLocalVideoEnable:(BOOL)enable;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------ | -------------------------- |
|
|
|
| enable | 是否开启 YES 开启/ NO 关闭 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 视频状态改变(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------- | ------------ |
|
|
|
| (void)onVideoStatusDidChange: userId: | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 视频状态改变
|
|
|
/// @param status 是否可用
|
|
|
/// @param userId 用户id
|
|
|
- (void)onVideoStatusDidChange:(BOOL)status userId:(NSString *)userId;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------ | -------- |
|
|
|
| status | 是否可用 |
|
|
|
| userId | 用户id |
|
|
|
|
|
|
<font color = '#ff2200'>**注:自己主动操作本地视频状态也会回调此代理**</font>
|
|
|
|
|
|
|
|
|
|
|
|
###### 设置本地音频开启(开始直播之后生效)(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ---------------------------------- |
|
|
|
| (BOOL)setLocalAudioEnable: | 设置本地音频开启(开始直播之后生效) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 设置本地音频开启(开始直播之后生效)
|
|
|
/// @param enable 是否开启 YES 开启/ NO 关闭
|
|
|
/// @return 是否操作成功
|
|
|
- (BOOL)setLocalAudioEnable:(BOOL)enable;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------ | -------------------------- |
|
|
|
| enable | 是否开启 YES 开启/ NO 关闭 |
|
|
|
|
|
|
|
|
|
|
|
|
###### 音频状态改变(多人连麦)(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------ | ------------ |
|
|
|
| (void)onAudioStatusDidChange: userId: byTeacher: | 音频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 音频状态改变
|
|
|
/// @param status 是否可用
|
|
|
/// @param userId 用户id
|
|
|
/// @param byTeacher 是否是老师操作
|
|
|
- (void)onAudioStatusDidChange:(BOOL)status userId:(NSString *)userId byTeacher:(BOOL)byTeacher;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| --------- | -------------- |
|
|
|
| status | 是否可用 |
|
|
|
| userId | 用户id |
|
|
|
| byTeacher | 是否是老师操作 |
|
|
|
|
|
|
<font color = '#ff2200'> **注:自己主动操作本地音频状态也会回调此代理**</font>
|
|
|
|
|
|
|
|
|
|
|
|
###### 切换本地摄像头,默认前置(多人连麦)(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------- | ------------------------ |
|
|
|
| (BOOL)switchCamera; | 切换本地摄像头,默认前置 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 切换本地摄像头,默认前置
|
|
|
/// @return 是否操作成功
|
|
|
- (BOOL)switchCamera;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 连麦异常(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------- | -------- |
|
|
|
| onConnectionException: | 异常挂断 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 异常挂断
|
|
|
/// @param error 错误原因
|
|
|
- (void)onConnectionException:(HDSMediaCallError)error;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ---------------------------------- | -------------------------------- |
|
|
|
| HDSMediaCallErrorInCalling | 连麦失败 |
|
|
|
| HDSMediaCallErrorRoomTypeDidChange | 连麦房间类型改变(需要退出重进) |
|
|
|
| HDSMediaCallErroronMumberLimit | 连麦人数已达上限 |
|
|
|
| HDSMediaCallErrorAbilityDown | 连麦功能不可用(需要退出重进) |
|
|
|
| HDSMediaCallErrorPullStreamFailed | 拉流失败 |
|
|
|
| HDSMediaCallErrorConnectTimeOut | 连麦申请超时 |
|
|
|
|
|
|
|
|
|
|
|
|
##### <font color = '#ff2200'>特别注意多人连麦需要退出房间重新登陆的事件</font>
|
|
|
|
|
|
| 房间配置事件 | 注释 |
|
|
|
| ------------------------------- | ------------------------------ |
|
|
|
| OnErrorType_LoginFailed | 登陆失败(需要退出重进) |
|
|
|
| initFailedClosure | 初始化SDK失败(需要退出重进) |
|
|
|
| OnErrorType_GetPlaySourceFailed | 获取播放源失败(需要退出重进) |
|
|
|
| OnErrorType_GetSummaryFailed | 获取摘要失败(需要退出重进) |
|
|
|
|
|
|
| 连麦事件 | 注释 |
|
|
|
| ---------------------------------- | -------------------------------- |
|
|
|
| HDSMeidaCallErrorRoomTypeDidChange | 连麦房间类型改变(需要退出重进) |
|
|
|
| HDSMeidaCallErrorAbilityDown | 连麦功能不可用(需要退出重进) |
|
|
|
|
|
|
|
|
|
|
|
|
##### 已删除API
|
|
|
|
|
|
###### ~~WebRTC连接成功(代理方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------ | ------------------------------------------------------------ |
|
|
|
| ~~(void)connectWebRTCSuccess~~ | ~~WebRTC连接成功,在此代理方法中主要做一些界面的更改 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief WebRTC连接成功,在此代理方法中主要做一些界面的更改 (已删除)
|
|
|
*/
|
|
|
- (void)connectWebRTCSuccess;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~当前是否可以连麦(代理方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------- | ----------------------------- |
|
|
|
| ~~(void)whetherOrNotConnectWebRTCNow:~~ | ~~当前是否可以连麦 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 当前是否可以连麦 (已删除)
|
|
|
*/
|
|
|
- (void)whetherOrNotConnectWebRTCNow:(BOOL)connect;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~主播端接受连麦请求(代理方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------- | -------------------------------- |
|
|
|
| ~~(void)acceptSpeak:~~ | ~~主播端接受连麦请求(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 主播端接受连麦请求,在此代理方法中,要调用DequestData对象的 (已删除)
|
|
|
* - (void)saveUserInfo:(NSDictionary *)dict remoteView:(UIView *)remoteView;方法
|
|
|
* 把收到的字典参数和远程连麦页面的view传进来,这个view需要自己设置并发给SDK,SDK将要在这个view上进行渲染
|
|
|
*/
|
|
|
- (void)acceptSpeak:(NSDictionary *)dict;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~主播端发送断开连麦的消息(代理方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ------------------------------------------------------------ |
|
|
|
| ~~(void)speak_disconnect~~ | ~~主播端发送断开连麦的消息,收到此消息后做断开连麦操作(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 主播端发送断开连麦的消息,收到此消息后做断开连麦操作 已删除)
|
|
|
*/
|
|
|
-(void)speak_disconnect:(BOOL)isAllow;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~本房间为允许连麦的房间(代理方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------- | ----------------------------------- |
|
|
|
| ~~(void)allowSpeakInteraction:~~ | ~~本房间为允许连麦的房间 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 本房间为允许连麦的房间,会回调此方法,在此方法中主要设置UI的逻辑,(已删除)
|
|
|
* 在断开推流,登录进入直播间和改变房间是否允许连麦状态的时候,都会回调此方法
|
|
|
*/
|
|
|
- (void)allowSpeakInteraction:(BOOL)isAllow;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~接收到的的参数(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------------- | ---------------------------- |
|
|
|
| ~~(void)saveUserInfo: remoteView:~~ | ~~接收到的的参数(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 当收到- (void)acceptSpeak:(NSDictionary *)dict;回调方法后,调用此方法(已删除)
|
|
|
* dict 正是- (void)acceptSpeak:(NSDictionary *)dict;接收到的的参数
|
|
|
* remoteView 是远程连麦页面的view,需要自己设置并发给SDK,SDK将要在这个view上进行远程画面渲染
|
|
|
*/
|
|
|
- (void)saveUserInfo:(NSDictionary *)dict remoteView:(UIView *)remoteView;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~观看端主动断开连麦时候需要调用的接口(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------- | ------------------------------------------------ |
|
|
|
| ~~(void)disConnectSpeak~~ | ~~观看端主动断开连麦时候需要调用的接口(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 观看端主动断开连麦时候需要调用的接口(已删除)
|
|
|
*/
|
|
|
- (void)disConnectSpeak;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~当观看端主动申请连麦时(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------------ | ------------------------------------ |
|
|
|
| ~~(void)requestAVMessageWithLocalView: isAudioVideo:~~ | ~~当观看端主动申请连麦时(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 当观看端主动申请连麦时,需要调用这个接口,并把本地连麦预览窗口传给SDK,SDK会在这个view上(已删除)
|
|
|
* 进行远程画面渲染
|
|
|
* param localView:本地预览窗口,传入本地view,连麦准备时间将会自动绘制预览画面在此view上
|
|
|
* param isAudioVideo:是否是音视频连麦,不是音视频即是纯音频连麦(YES表示音视频连麦,NO表示音频连麦)
|
|
|
*/
|
|
|
-(void)requestAVMessageWithLocalView:(UIView *)localView isAudioVideo:(BOOL)isAudioVideo;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~设置本地预览窗口的大小(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------ | ------------------------------------ |
|
|
|
| ~~(void)setLocalVideoFrameA:~~ | ~~设置本地预览窗口的大小(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 设置本地预览窗口的大小,连麦成功后调用才生效,连麦不成功调用不生效(已删除)
|
|
|
*/
|
|
|
-(void)setLocalVideoFrameA:(CGRect)localVideoFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~设置远程连麦窗口的大小(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------- | ------------------------------------------------------------ |
|
|
|
| ~~(void)setRemoteVideoFrameA:~~ | ~~设置远程连麦窗口的大小,连麦成功后调用才生效,连麦不成功调用不生效(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 设置远程连麦窗口的大小,连麦成功后调用才生效,连麦不成功调用不生效(已删除)
|
|
|
*/
|
|
|
-(void)setRemoteVideoFrameA:(CGRect)remoteVideoFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
###### ~~将要连接WebRTC(主动方法)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------- | ---------------------------- |
|
|
|
| ~~(void)gotoConnectWebRTC~~ | ~~将要连接WebRTC(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 将要连接WebRTC(已删除)
|
|
|
*/
|
|
|
-(void)gotoConnectWebRTC;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 红包雨
|
|
|
|
|
|
##### 查询正在进行中的红包雨(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------- | ---------------------- |
|
|
|
| (void)requestRedPacket: closure: | 查询正在进行中的红包雨 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 查询正在进行中的红包雨
|
|
|
* @param redPacketId 红包雨ID (没有传空@"")
|
|
|
* @param closure 回调
|
|
|
*/
|
|
|
- (void)requestRedPacket:(NSString *)redPacketId
|
|
|
closure:(void(^)(HDSRedPacketModel *model))closure;
|
|
|
```
|
|
|
|
|
|
[HDSRedPacketModel](#divtop)
|
|
|
|
|
|
|
|
|
|
|
|
##### 开始红包雨(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------- | ---------- |
|
|
|
| (void)HDSRedPacketDidStart: | 开始红包雨 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 开始红包雨
|
|
|
* @param redPacketId 红包雨ID
|
|
|
*/
|
|
|
- (void)HDSRedPacketDidStart:(NSString *)redPacketId;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 抢红包(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------- | ------ |
|
|
|
| (void)gradRedPacket: closure: | 抢红包 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 抢红包
|
|
|
* @param redPacketId 红包雨ID
|
|
|
* @param closure 回调
|
|
|
*/
|
|
|
- (void)gradRedPacket:(NSString *)redPacketId
|
|
|
closure:(void(^)(BOOL result))closure;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 结束红包雨(代理方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------- | ---------- |
|
|
|
| (void)HDSRedPacketDidEnd: | 结束红包雨 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 结束红包雨
|
|
|
* @param redPacketId 红包雨ID
|
|
|
*/
|
|
|
- (void)HDSRedPacketDidEnd:(NSString *)redPacketId;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 查询红包雨排行榜(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | ---------------- |
|
|
|
| (void)requestRedPacketRankList: closure: | 查询红包雨排行榜 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 查询红包雨排行榜
|
|
|
* @param redPacketId 红包雨ID
|
|
|
* @param closure 回调
|
|
|
*/
|
|
|
- (void)requestRedPacketRankList:(NSString *)redPacketId
|
|
|
closure:(void(^)(HDSRedPacketRankModel *model))closure;
|
|
|
```
|
|
|
|
|
|
[HDSRedPacketRankModel](#divtop1)
|
|
|
|
|
|
|
|
|
|
|
|
#### 其他已删除的API
|
|
|
|
|
|
##### ~~在线房间人数~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------- | -------------------------- |
|
|
|
| ~~(void)roomUserCount~~ | ~~在线房间人数(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* SDK会主动调用 - (void)onUserCount:(NSString *)count;
|
|
|
* @brief 获取在线房间人数,当登录成功后即可调用此接口,登录不成功或者退出登录后就不可以调用了,如果要求实时性比较强的话,可以写一个定时器,不断调用此接口,几秒钟发一次就可以,然后在代理回调函数中,处理返回的数据
|
|
|
*/
|
|
|
- (void)roomUserCount;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~用于调整PPT缩放模式~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------------- | -------------------------------- |
|
|
|
| ~~(void)changeDocFrame: withPPTScalingMode:;~~ | ~~用于调整PPT缩放模式 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 主动调用方法 用于调整PPT缩放模式 (已删除)
|
|
|
* @param docFrame 文档的frame
|
|
|
* @param PPTScalingMode PPT缩放模式
|
|
|
* 1 = 拉伸填充:PPT内容全部展示在显示区域,会被拉伸或压缩,不会存在黑边
|
|
|
* 2 = 等比居中:PPT内容保持原始比例,适应窗口展示在显示区域,会存在黑边
|
|
|
* 3 = 等比填充:PPT内容保持原始比例,以横向或纵向适应显示区域,另一方向将会超出显示区域,超出部分会被裁减,不会存在黑边
|
|
|
*
|
|
|
* 需要调整docFrame 请直接调用 - (void)changeDocFrame:(CGRect)docFrame;方法
|
|
|
*/
|
|
|
- (void)changeDocFrame:(CGRect)docFrame withPPTScalingMode:(NSInteger)PPTScalingMode;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~防录屏~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------ | ---------------------------- |
|
|
|
| ~~(void)setAntiRecordScreen:~~ | ~~设置防录屏功能 (已删除) ~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 设置防录屏功能 (已删除)
|
|
|
* @param isEnable YES 开启 NO 关闭(默认)
|
|
|
*/
|
|
|
- (void)setAntiRecordScreen:(BOOL)isEnable;
|
|
|
```
|
|
|
|
|
|
PS:防录屏功能拆分到demo层处理,具体实现参考 4.0.0 demo
|
|
|
|
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
### 在线回放(Playback)
|
|
|
|
|
|
#### 初始化SDK(主动方法)
|
|
|
|
|
|
##### 初始化SDK(新)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------- | --------- |
|
|
|
| (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失败回调 |
|
|
|
|
|
|
##### ~~初始化SDK(旧)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ----------------------- |
|
|
|
| ~~(id)initWithParameter:~~ | ~~初始化SDK(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 进入房间,并请求画图聊天数据并播放视频(可以不登陆,直接从此接口进入直播间)
|
|
|
* @param parameter 配置参数信息
|
|
|
* 必填参数 userId;
|
|
|
* 必填参数 roomId;
|
|
|
* 必填参数 viewerName;
|
|
|
* 必填参数 token;
|
|
|
* 必填参数 docParent;
|
|
|
* 必填参数 docFrame;
|
|
|
* 必填参数 playerParent;
|
|
|
* 必填参数 playerFrame;
|
|
|
* 非必填参数 security;
|
|
|
* 必填参数 pauseInBackGround;
|
|
|
* 必填参数 defaultColor;
|
|
|
* 必填参数 PPTScalingMode;
|
|
|
* 必填参数 scalingMode;
|
|
|
*/
|
|
|
- (id)initWithParameter:(PlayParameter *)parameter;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 播放器
|
|
|
|
|
|
##### 流视图(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) {
|
|
|
|
|
|
}];
|
|
|
```
|
|
|
|
|
|
##### ~~播放器实例~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | -------------------- |
|
|
|
| ~~ijkPlayer~~ | ~~播放器(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器 (已删除)
|
|
|
*/
|
|
|
@property (retain, atomic) HDFFMoviePlayerController *ijkPlayer;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器frame~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------ | ----------------------------- |
|
|
|
| ~~(void)changePlayerFrame:(CGRect) playerFrame~~ | ~~改变播放器frame(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器frame (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerFrame:(CGRect) playerFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器父窗口~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------- | ------------------------------ |
|
|
|
| ~~(void)changePlayerParent:~~ | ~~改变播放器父窗口(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器父窗口 (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerParent:(UIView *) playerParent;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流加载状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | -------------- |
|
|
|
| (HDSMediaLoadState)getMediaLoadStatus | 获取流加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流加载状态
|
|
|
- (HDSMediaLoadState)getMediaLoadStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaLoadState](#divtop4)
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流播放状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | -------------- |
|
|
|
| (HDSMediaPlaybackState)getMediaPlayStatus | 获取流播放状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流播放状态
|
|
|
- (HDSMediaPlaybackState)getMediaPlayStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaPlaybackState](#divtop5)
|
|
|
|
|
|
|
|
|
|
|
|
##### 播放器准备完成(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------------- | --------------------------- |
|
|
|
| (void)HDMediaPlaybackIsPreparedToPlayDidChange | 播放器准备完成 (会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------------------- | -------------------------- |
|
|
|
| ~~(void)HDMediaPlaybackIsPreparedToPlayDidChange:~~ | 播放器准备完成(会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)(已变更)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange:(NSDictionary *)dict;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频状态改变(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------- | ------------ |
|
|
|
| (void)HDSMediaPlayBackStateDidChange: | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变
|
|
|
* @param state
|
|
|
* HDSMediaPlaybackStateStopped 播放停止
|
|
|
* HDSMediaPlaybackStatePlaying 开始播放
|
|
|
* HDSMediaPlaybackStatePaused 暂停播放
|
|
|
* HDSMediaPlaybackStateInterrupted 播放间断
|
|
|
* HDSMediaPlaybackStateSeekingForward 播放快进
|
|
|
* HDSMeidaPlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDSMediaPlayBackStateDidChange:(HDSMeidaPlaybackState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | ------------ |
|
|
|
| ~~(void)HDMoviePlayBackStateDidChange:~~ | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变(已变更)
|
|
|
* @param state
|
|
|
* HDMoviePlaybackStateStopped 播放停止
|
|
|
* HDMoviePlaybackStatePlaying 开始播放
|
|
|
* HDMoviePlaybackStatePaused 暂停播放
|
|
|
* HDMoviePlaybackStateInterrupted 播放间断
|
|
|
* HDMoviePlaybackStateSeekingForward 播放快进
|
|
|
* HDMoviePlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDMoviePlayBackStateDidChange:(HDMoviePlaybackState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频加载状态(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | ------------ |
|
|
|
| (void)HDSMediaLoadStateDidChange: | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态
|
|
|
* @param state 播放状态
|
|
|
* HDSMediaLoadStateUnknown 未知状态
|
|
|
* HDSMediaLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDSMediaLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDSMediaLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDSMediaLoadStateDidChange:(HDSMediaLoadState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | ------------ |
|
|
|
| ~~(void)HDMovieLoadStateDidChange:~~ | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态(已变更)
|
|
|
* @param state 播放状态
|
|
|
* HDMovieLoadStateUnknown 未知状态
|
|
|
* HDMovieLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDMovieLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDMovieLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDMovieLoadStateDidChange:(HDMovieLoadState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频播放完成原因(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------------- | ---------------- |
|
|
|
| (void)HDSMediaPlayerPlaybackDidFinish: | 视频播放完成原因 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频播放完成原因
|
|
|
* @param reason 原因
|
|
|
* HDSMediaFinishReasonPlaybackEnded 自然播放结束
|
|
|
* HDSMediaFinishReasonUserExited 用户人为结束
|
|
|
* HDSMeidaFinishReasonPlaybackError 发生错误崩溃结束
|
|
|
*/
|
|
|
- (void)HDSMediaPlayerPlaybackDidFinish:(HDSMeidaFinishReason)reason;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------------------- | ---------------- |
|
|
|
| ~~(void)HDMoviePlayerPlaybackDidFinish:~~ | 视频播放完成原因 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频播放完成原因 (已变更)
|
|
|
* @param reason 原因
|
|
|
* HDMovieFinishReasonPlaybackEnded 自然播放结束
|
|
|
* HDMovieFinishReasonUserExited 用户人为结束
|
|
|
* HDMovieFinishReasonPlaybackError 发生错误崩溃结束
|
|
|
*/
|
|
|
- (void)HDMoviePlayerPlaybackDidFinish:(HDMovieFinishReason)reason;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~切换线路~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------------------------- | --------------------- |
|
|
|
| ~~(void)changeLineWithPlayParameter: completion:~~ | ~~切换线路 (已删除)~~ |
|
|
|
|
|
|
示例代码:
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 切换线路 (已删除)
|
|
|
* param
|
|
|
* disableVideo 视频传no,音频传yes(账号开启音频模式下才可以传yes)
|
|
|
* lineNum 线路 例:-(void)numberOfReceivedLinesWithVideo:(NSArray *)videoArray audio:(NSArray *)audioArray;中videoArray元素个数为2 则传0或1
|
|
|
* results:
|
|
|
success 0 切换成功 -1切换失败 -2 切换频繁
|
|
|
currentIndex 当前播放线路
|
|
|
*
|
|
|
* 废弃版本 3.13.0
|
|
|
* 兼容版本 2021年10月08日之后将不再维护
|
|
|
* 新方法 切换播放器类型 - (void)changePlayMode:(PLAY_MODE_TYEP)mode;
|
|
|
* 切换清晰度 - (void)changeQuality:(NSString *)quality completion:(void (^)(NSDictionary * results))completion;
|
|
|
* 切换线路 - (void)changeLine:(NSInteger)index completion:(void (^)(NSDictionary * results))completion;
|
|
|
*
|
|
|
*/
|
|
|
- (void)changeLineWithPlayParameter:(PlayParameter *)param completion:(void (^)(NSDictionary * results))completion;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~接收到播放线路 (已删除)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------------------------- | --------------------------- |
|
|
|
| ~~(void)numberOfReceivedLinesWithVideo:audio:~~ | ~~接收到播放线路 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 接收到播放线路 (已删除)
|
|
|
* 例:videoArray元素个数 2 代表2条线路 changeLineWithPlayParameter传0或1
|
|
|
*
|
|
|
* 废弃版本 3.13.0
|
|
|
* 兼容版本 2021年10月08日之后将不再维护
|
|
|
* 新方法 清晰度回调 - (void)HDReceivedVideoQuality:(NSDictionary *)dict;
|
|
|
* 线路回调 - (void)HDReceivedVideoAudioLines:(NSDictionary *)dict;
|
|
|
*
|
|
|
*/
|
|
|
-(void)numberOfReceivedLinesWithVideo:(NSArray *)videoArray audio:(NSArray *)audioArray;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取播放速率
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------- | ------------ |
|
|
|
| (CGFloat)getMediaRate | 获取播放速率 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取播放速率
|
|
|
- (CGFloat)getMediaRate;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 设置播放速率
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------- | ------------ |
|
|
|
| (void)setMediaRate: | 设置播放速率 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 设置播放速率
|
|
|
- (void)setMediaRate:(CGFloat)rate;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 其他已删除的API
|
|
|
|
|
|
##### ~~请求回放地址成功~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------ | ------------------------------- |
|
|
|
| ~~(void)requestSucceed~~ | ~~请求回放地址成功 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 请求回放地址成功 (已删除)
|
|
|
*
|
|
|
* 废弃版本 3.16.2
|
|
|
* 兼容版本 2021年12月1日后将不再维护
|
|
|
* 新方法: - (void)mediaPrepared;
|
|
|
*/
|
|
|
-(void)requestSucceed;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~从直播开始到现在的秒数,SDK会在画板上绘画出来相应的图形~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------ | ---------------------------------- |
|
|
|
| ~~continueFromTheTime:~~ | ~~开始播放到现在的描述(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/** (已删除)
|
|
|
* @brief time:从直播开始到现在的秒数,SDK会在画板上绘画出来相应的图形
|
|
|
*/
|
|
|
- (void)continueFromTheTime:(NSInteger)time;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~获取随堂测信息~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------- | ---------------------------- |
|
|
|
| ~~(void)getPracticeInformation~~ | ~~获取随堂测信息(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 获取随堂测信息 (已删除)
|
|
|
*
|
|
|
* 废弃版本 3.16.2
|
|
|
* 兼容版本 2021年12月1日后将不再维护
|
|
|
* 新方法: - (void)fetchAllPractic:(void (^)(NSArray * results))completion;
|
|
|
* 注意: 主动调用 - (void)fetchAllPractic:(void (^)(NSArray * results))completion; 方法,需要依赖 - (void)dataPrepared; 全数据准备完成
|
|
|
*/
|
|
|
- (void)getPracticeInformation;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~接收到随堂测 (已删除)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | --------------------------- |
|
|
|
| ~~(void)receivePracticeWithDic:~~ | ~~接收到随堂测 (已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 接收到随堂测 (已删除)
|
|
|
* rseultDic 随堂测内容
|
|
|
* 废弃版本 3.16.2
|
|
|
* 兼容版本 2021年12月1日后将不再维护
|
|
|
* 新方法: - (void)fetchAllPractic:(void (^)(NSArray * results))completion;
|
|
|
* 注意: 主动调用 - (void)fetchAllPractic:(void (^)(NSArray * results))completion; 方法,需要依赖 - (void)dataPrepared; 全数据准备完成
|
|
|
*/
|
|
|
-(void)receivePracticeWithDic:(NSDictionary *)resultDic;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~用于调整PPT缩放模式~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | --------------------------------- |
|
|
|
| (void)changeDocFrame:withPPTScalingMode: | ~~用于调整PPT缩放模式(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 主动调用方法 用于调整PPT缩放模式 (已删除)
|
|
|
* @param docFrame 文档的frame
|
|
|
* @param PPTScalingMode PPT缩放模式
|
|
|
* 1 = 拉伸填充:PPT内容全部展示在显示区域,会被拉伸或压缩,不会存在黑边
|
|
|
* 2 = 等比居中:PPT内容保持原始比例,适应窗口展示在显示区域,会存在黑边
|
|
|
* 3 = 等比填充:PPT内容保持原始比例,以横向或纵向适应显示区域,另一方向将会超出显示区域,超出部分会被裁减,不会存在黑边
|
|
|
*
|
|
|
* 需要调整docFrame 请直接调用 - (void)changeDocFrame:(CGRect)docFrame;方法
|
|
|
*/
|
|
|
- (void)changeDocFrame:(CGRect)docFrame withPPTScalingMode:(NSInteger)PPTScalingMode;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~设置防录屏功能~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------ | ---------------------------- |
|
|
|
| ~~(void)setAntiRecordScreen:~~ | ~~设置防录屏功能(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 设置防录屏功能 (已删除)
|
|
|
* @param isEnable YES 开启 NO 关闭(默认)
|
|
|
*/
|
|
|
- (void)setAntiRecordScreen:(BOOL)isEnable;
|
|
|
```
|
|
|
|
|
|
PS:防录屏功能拆分到demo层处理,具体实现参考 4.0.0 demo
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~获取全量广播数据~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------- | ------------------------------ |
|
|
|
| ~~(void)fetchAllBoardcast:~~ | ~~获取全量广播数据(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 获取全量广播数据 (已删除)
|
|
|
* @param completion 数据回调
|
|
|
*
|
|
|
* 废弃版本: 3.16.2
|
|
|
* 兼容版本: 2021年12月01日之后将不再维护
|
|
|
* 新方法: - (void)fetchAllBroadcast:(void (^)(NSArray * results))completion;
|
|
|
*/
|
|
|
- (void)fetchAllBoardcast:(void (^)(NSArray * results))completion;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
### 离线回放(Offline)
|
|
|
|
|
|
#### 初始化SDK(主动方法)
|
|
|
|
|
|
##### 初始化SDK(新)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------- | --------- |
|
|
|
| (id)initSDKWithParameter: succed: player: failed: | 初始化SDK |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 初始化
|
|
|
/// @param parameter 配置参数信息
|
|
|
/// 必填参数 docFrame;
|
|
|
/// 必填参数 docParent;
|
|
|
/// 必填参数 scalingMode;
|
|
|
/// 必填参数 destination;
|
|
|
/// 必填参数 defaultColor;
|
|
|
/// 必填参数 PPTScalingMode;
|
|
|
/// 必填参数 pauseInBackGround;
|
|
|
- (id)initSDKWithParameter:(PlayParameter *)parameter
|
|
|
succed:(initSuccedClosure)succed
|
|
|
player:(HDSPlayerViewClosure)player
|
|
|
failed:(initFailedClosure)failed;
|
|
|
```
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| --------- | ------------------------------------------------------------ |
|
|
|
| parameter | 初始化SDK参数,其中 "playerParent","playerFrame" 已废弃删除,新的流视图由 HDSPlayerViewClosure 异步回调,自行处理 |
|
|
|
| succed | 初始化SDK成功回调 |
|
|
|
| player | 流视图异步回调,存在回调多次; |
|
|
|
| failed | 初始化SDK失败回调 |
|
|
|
|
|
|
##### ~~初始化SDK(旧)~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------- | ----------------------- |
|
|
|
| ~~(id)initWithParameter:~~ | ~~初始化SDK(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 初始化
|
|
|
* @param parameter 配置参数信息
|
|
|
* 必填参数 docFrame;
|
|
|
* 必填参数 docParent;
|
|
|
* 必填参数 playerParent;
|
|
|
* 必填参数 playerFrame;
|
|
|
* 必填参数 scalingMode;
|
|
|
* 必填参数 destination;
|
|
|
* 必填参数 defaultColor;
|
|
|
* 必填参数 PPTScalingMode;
|
|
|
* 必填参数 pauseInBackGround;
|
|
|
*/
|
|
|
- (id)initWithParameter:(PlayParameter *)parameter;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 播放器
|
|
|
|
|
|
##### 流视图(callback回调)
|
|
|
|
|
|
| 注意 |
|
|
|
| ------------------------------------------------------------ |
|
|
|
| **“新的流视图”** 通过 初始化SDK(initSDKWithParameter:)方法中的 **player:**,通过 **callback 返回 “流视图”** |
|
|
|
| **“流视图”**(属于UIView 类型),所在 **视图区域**,**视图大小** 可根据业务自行调整设置 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
_offlinePlayBack = [[OfflinePlayBack alloc] initSDKWithParameter:parameter succed:^(BOOL succed) {
|
|
|
|
|
|
} player:^(UIView * _Nonnull playerView) {
|
|
|
--> ** playerView ** 即为视频流视图
|
|
|
} failed:^(NSError *error, NSString *reason) {
|
|
|
|
|
|
}];
|
|
|
```
|
|
|
|
|
|
##### ~~播放器实例~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------- | -------------------- |
|
|
|
| ~~ijkPlayer~~ | ~~播放器(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
@property (retain, atomic) id<HDMediaPlayback> ijkPlayer;//播放器
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器frame~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------------------ | ----------------------------- |
|
|
|
| ~~(void)changePlayerFrame:(CGRect) playerFrame~~ | ~~改变播放器frame(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器frame (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerFrame:(CGRect) playerFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~改变播放器父窗口~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------- | ------------------------------ |
|
|
|
| ~~(void)changePlayerParent:~~ | ~~改变播放器父窗口(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 改变播放器父窗口 (已删除)
|
|
|
*/
|
|
|
- (void)changePlayerParent:(UIView *) playerParent;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流加载状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | -------------- |
|
|
|
| (HDSMediaLoadState)getMediaLoadStatus | 获取流加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流加载状态
|
|
|
- (HDSMediaLoadState)getMediaLoadStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaLoadState](#divtop4)
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取流播放状态(主动方法)
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | -------------- |
|
|
|
| (HDSMediaPlaybackState)getMediaPlayStatus | 获取流播放状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取流播放状态
|
|
|
- (HDSMediaPlaybackState)getMediaPlayStatus;
|
|
|
```
|
|
|
|
|
|
[HDSMediaPlaybackState](#divtop5)
|
|
|
|
|
|
|
|
|
|
|
|
##### 播放器准备完成(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------------- | --------------------------- |
|
|
|
| (void)HDMediaPlaybackIsPreparedToPlayDidChange | 播放器准备完成 (会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------------------------- | -------------------------- |
|
|
|
| ~~(void)HDMediaPlaybackIsPreparedToPlayDidChange:~~ | 播放器准备完成(会多次回调) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 播放器准备完成 (会多次回调)(已变更)
|
|
|
*/
|
|
|
- (void)HDMediaPlaybackIsPreparedToPlayDidChange:(NSDictionary *)dict;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频状态改变(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------- | ------------ |
|
|
|
| (void)HDSMediaPlayBackStateDidChange: | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变
|
|
|
* @param state
|
|
|
* HDSMediaPlaybackStateStopped 播放停止
|
|
|
* HDSMediaPlaybackStatePlaying 开始播放
|
|
|
* HDSMediaPlaybackStatePaused 暂停播放
|
|
|
* HDSMediaPlaybackStateInterrupted 播放间断
|
|
|
* HDSMediaPlaybackStateSeekingForward 播放快进
|
|
|
* HDSMeidaPlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDSMediaPlayBackStateDidChange:(HDSMeidaPlaybackState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ---------------------------------------- | ------------ |
|
|
|
| ~~(void)HDMoviePlayBackStateDidChange:~~ | 视频状态改变 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频状态改变(已变更)
|
|
|
* @param state
|
|
|
* HDMoviePlaybackStateStopped 播放停止
|
|
|
* HDMoviePlaybackStatePlaying 开始播放
|
|
|
* HDMoviePlaybackStatePaused 暂停播放
|
|
|
* HDMoviePlaybackStateInterrupted 播放间断
|
|
|
* HDMoviePlaybackStateSeekingForward 播放快进
|
|
|
* HDMoviePlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
- (void)HDMoviePlayBackStateDidChange:(HDMoviePlaybackState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频加载状态(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------------------- | ------------ |
|
|
|
| (void)HDSMediaLoadStateDidChange: | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态
|
|
|
* @param state 播放状态
|
|
|
* HDSMediaLoadStateUnknown 未知状态
|
|
|
* HDSMediaLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDSMediaLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDSMediaLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDSMediaLoadStateDidChange:(HDSMediaLoadState)state;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------------ | ------------ |
|
|
|
| ~~(void)HDMovieLoadStateDidChange:~~ | 视频加载状态 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频加载状态(已变更)
|
|
|
* @param state 播放状态
|
|
|
* HDMovieLoadStateUnknown 未知状态
|
|
|
* HDMovieLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDMovieLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDMovieLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
- (void)HDMovieLoadStateDidChange:(HDMovieLoadState)state;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 视频播放完成原因(代理方法)
|
|
|
|
|
|
###### 新API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------------- | ---------------- |
|
|
|
| (void)HDSMediaPlayerPlaybackDidFinish: | 视频播放完成原因 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频播放完成原因
|
|
|
* @param reason 原因
|
|
|
* HDSMediaFinishReasonPlaybackEnded 自然播放结束
|
|
|
* HDSMediaFinishReasonUserExited 用户人为结束
|
|
|
* HDSMeidaFinishReasonPlaybackError 发生错误崩溃结束
|
|
|
*/
|
|
|
- (void)HDSMediaPlayerPlaybackDidFinish:(HDSMeidaFinishReason)reason;
|
|
|
```
|
|
|
|
|
|
###### 旧API
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ----------------------------------------- | ---------------- |
|
|
|
| ~~(void)HDMoviePlayerPlaybackDidFinish:~~ | 视频播放完成原因 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频播放完成原因 (已变更)
|
|
|
* @param reason 原因
|
|
|
* HDMovieFinishReasonPlaybackEnded 自然播放结束
|
|
|
* HDMovieFinishReasonUserExited 用户人为结束
|
|
|
* HDMovieFinishReasonPlaybackError 发生错误崩溃结束
|
|
|
*/
|
|
|
- (void)HDMoviePlayerPlaybackDidFinish:(HDMovieFinishReason)reason;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 获取播放速率
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| --------------------- | ------------ |
|
|
|
| (CGFloat)getMediaRate | 获取播放速率 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 获取播放速率
|
|
|
- (CGFloat)getMediaRate;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### 设置播放速率
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------- | ------------ |
|
|
|
| (void)setMediaRate: | 设置播放速率 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 设置播放速率
|
|
|
- (void)setMediaRate:(CGFloat)rate;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 其他已删除的API
|
|
|
|
|
|
##### ~~从直播开始到现在的秒数,SDK会在画板上绘画出来相应的图形~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------ | ---------------------------------- |
|
|
|
| ~~continueFromTheTime:~~ | ~~开始播放到现在的描述(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/** (已删除)
|
|
|
* @brief time:从直播开始到现在的秒数,SDK会在画板上绘画出来相应的图形
|
|
|
*/
|
|
|
- (void)continueFromTheTime:(NSInteger)time;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~用于调整PPT缩放模式~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| -------------------------------------------- | --------------------------------- |
|
|
|
| ~~(void)changeDocFrame:withPPTScalingMode:~~ | ~~用于调整PPT缩放模式(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 主动调用方法 用于调整PPT缩放模式 (已删除)
|
|
|
* @param docFrame 文档的frame
|
|
|
* @param PPTScalingMode PPT缩放模式
|
|
|
* 1 = 拉伸填充:PPT内容全部展示在显示区域,会被拉伸或压缩,不会存在黑边
|
|
|
* 2 = 等比居中:PPT内容保持原始比例,适应窗口展示在显示区域,会存在黑边
|
|
|
* 3 = 等比填充:PPT内容保持原始比例,以横向或纵向适应显示区域,另一方向将会超出显示区域,超出部分会被裁减,不会存在黑边
|
|
|
*
|
|
|
* 需要调整docFrame 请直接调用 - (void)changeDocFrame:(CGRect)docFrame;方法
|
|
|
*/
|
|
|
- (void)changeDocFrame:(CGRect)docFrame withPPTScalingMode:(NSInteger)PPTScalingMode;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~设置防录屏功能~~
|
|
|
|
|
|
| 方法 | 注释 |
|
|
|
| ------------------------------ | ---------------------------- |
|
|
|
| ~~(void)setAntiRecordScreen:~~ | ~~设置防录屏功能(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 设置防录屏功能 (已删除)
|
|
|
* @param isEnable YES 开启 NO 关闭(默认)
|
|
|
*/
|
|
|
- (void)setAntiRecordScreen:(BOOL)isEnable;
|
|
|
```
|
|
|
|
|
|
PS:防录屏功能拆分到demo层处理,具体实现参考 4.0.0 demo
|
|
|
|
|
|
|
|
|
|
|
|
***
|
|
|
|
|
|
### PlayParameter
|
|
|
|
|
|
#### 新增参数
|
|
|
|
|
|
##### <a name="divtop">HDSRedPacketModel </a>
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ----------- | ------------------------------ |
|
|
|
| id | 本次红包雨 ID |
|
|
|
| duration | 红包雨持续时长 |
|
|
|
| startTime | 红包雨开始时间 |
|
|
|
| currentTime | 当前系统时间 |
|
|
|
| slidingRate | 红包雨滑动速率 0:慢 1:中 2:快 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// ID
|
|
|
@property (nonatomic, copy) NSString * _Nullable id;
|
|
|
/// 红包雨时长
|
|
|
@property (nonatomic, assign) NSInteger duration;
|
|
|
/// 红包雨开始时间
|
|
|
@property (nonatomic, assign) NSTimeInterval startTime;
|
|
|
/// 当前系统时间
|
|
|
@property (nonatomic, assign) NSTimeInterval currentTime;
|
|
|
/// 红包雨滑动速率 0:慢 1:中 2:快
|
|
|
@property (nonatomic, assign) NSInteger slidingRate;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### <a name="divtop1">HDSRedPacketRankModel </a>
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------------ | ------------------ |
|
|
|
| totalAmount | 总共抢到的学分 |
|
|
|
| remainAmount | 剩余学分 |
|
|
|
| userCount | 抢到红包的学员数量 |
|
|
|
| 排行榜数据 | rankList |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 总共抢到的学分
|
|
|
@property (nonatomic, copy) NSString * _Nullable totalAmount;
|
|
|
/// 剩余学分
|
|
|
@property (nonatomic, copy) NSString * _Nullable remainAmount;
|
|
|
/// 抢到红包的学员数量
|
|
|
@property (nonatomic, assign) NSInteger userCount;
|
|
|
/// 排行榜数据
|
|
|
@property (nonatomic, strong) NSArray * _Nullable rankList;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### <a name="divtop2">HDSRedRacketRankListModel </a>
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------- | ---------- |
|
|
|
| userId | 用户id |
|
|
|
| userName | 用户昵称 |
|
|
|
| amount | 得分 |
|
|
|
| isMyself | 是否是自己 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 用户id
|
|
|
@property (nonatomic, copy) NSString * _Nullable userId;
|
|
|
/// 用户昵称
|
|
|
@property (nonatomic, copy) NSString * _Nullable userName;
|
|
|
/// 得分
|
|
|
@property (nonatomic, assign) NSInteger amount;
|
|
|
/// 是否是自己
|
|
|
@property (nonatomic, assign) BOOL isMyself;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### <a name="divtop4">HDSMediaLoadState </a>
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ----------------------------- | ---------------------------------------------- |
|
|
|
| HDSMediaLoadStateUnknown | 未知状态 |
|
|
|
| HDSMediaLoadStatePlayable | 视频未完成全部缓存,但已缓存的数据可以进行播放 |
|
|
|
| HDSMediaLoadStatePlaythroughOK | 缓冲已经完成 |
|
|
|
| HDSMediaLoadStateStalled | 缓冲已经开始 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* 视频加载状态
|
|
|
* HDSMediaLoadStateUnknown 未知状态
|
|
|
* HDSMediaLoadStatePlayable 视频未完成全部缓存,但已缓存的数据可以进行播放
|
|
|
* HDSMediaLoadStatePlaythroughOK 缓冲已经完成
|
|
|
* HDSMediaLoadStateStalled 缓冲已经开始
|
|
|
*/
|
|
|
typedef NS_ENUM(NSUInteger, HDSMediaLoadState) {
|
|
|
HDSMediaLoadStateUnknown,
|
|
|
HDSMediaLoadStatePlayable,
|
|
|
HDSMediaLoadStatePlaythroughOK,
|
|
|
HDSMediaLoadStateStalled,
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### <a name="divtop5">HDSMediaPlaybackState </a>
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ----------------------------------- | -------- |
|
|
|
| HDSMediaPlaybackStateStopped | 播放停止 |
|
|
|
| HDSMediaPlaybackStatePlaying | 开始播放 |
|
|
|
| HDSMediaPlaybackStatePaused | 暂停播放 |
|
|
|
| HDSMediaPlaybackStateInterrupted | 播放间断 |
|
|
|
| HDSMediaPlaybackStateSeekingForward | 播放快进 |
|
|
|
| HDSMediaPlaybackStateSeekingBackward | 播放后退 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* 视频播放状态
|
|
|
* HDSMediaPlaybackStateStopped 播放停止
|
|
|
* HDSMediaPlaybackStatePlaying 开始播放
|
|
|
* HDSMediaPlaybackStatePaused 暂停播放
|
|
|
* HDSMediaPlaybackStateInterrupted 播放间断
|
|
|
* HDSMediaPlaybackStateSeekingForward 播放快进
|
|
|
* HDSMediaPlaybackStateSeekingBackward 播放后退
|
|
|
*/
|
|
|
typedef NS_ENUM(NSUInteger, HDSMediaPlaybackState) {
|
|
|
HDSMediaPlaybackStateStopped,
|
|
|
HDSMediaPlaybackStatePlaying,
|
|
|
HDSMediaPlaybackStatePaused,
|
|
|
HDSMediaPlaybackStateInterrupted,
|
|
|
HDSMediaPlaybackStateSeekingForward,
|
|
|
HDSMediaPlaybackStateSeekingBackward,
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### HDSRoomCallInfo
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| --------------------- | ------------------------------------------------------------ |
|
|
|
| isMultiMediaCallRoom | 是否是多人连麦房间( YES 多人连麦 / NO 单人连麦 ) |
|
|
|
| isMediaCallFuncEnable | 是否开启连麦功能 ( YES 房间连麦功能开启 / NO 房间连麦功能未开启 ) |
|
|
|
| disableReason | 房间连麦功能未开启原因 |
|
|
|
| roomCallType | 连麦类型 ( HDSRoomCallType ) |
|
|
|
|
|
|
```objc
|
|
|
/// 是否是多人连麦房间
|
|
|
@property (nonatomic, assign) BOOL isMultiMediaCallRoom;
|
|
|
/// 是否开启连麦功能
|
|
|
@property (nonatomic, assign) BOOL isMediaCallFuncEnable;
|
|
|
/// 房间连麦功能未开启原因
|
|
|
@property (nonatomic, assign) HDSMediaCallAbilityDisableReason disableReason;
|
|
|
/// 连麦类型
|
|
|
@property (nonatomic, assign) HDSRoomCallType roomCallType;
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, HDSRoomCallType) {
|
|
|
HDSRoomCallTypeAudio, /// 音频连麦房间 (多人连麦情况下只能申请音频连麦)
|
|
|
HDSRoomCallTypeAudioVideo, /// 视频连麦房间 (单人连麦可申请音频或视频连麦)
|
|
|
};
|
|
|
```
|
|
|
|
|
|
##### HDSMediaCallAbilityDisableReason
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------------------------------------- | ---------- |
|
|
|
| HDSMediaCallAbilityDisableReasonNone | 无 |
|
|
|
| HDSMediaCallAbilityDisableReasonRoomNotOpen | 房间未开启 |
|
|
|
| HDSMediaCallAbilityDisableReasonTeacherClose | 讲师关闭 |
|
|
|
| HDSMediaCallAbilityDisableReasonLiveEnd | 直播结束 |
|
|
|
| HDSMediaCallAbilityDisableReasonLiveBan | 直播封禁 |
|
|
|
| HDSMediaCallAbilityDisableReasonNotNetwork | 无网络 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 连麦功能不可用原因
|
|
|
typedef NS_ENUM(NSUInteger, HDSMediaCallAbilityDisableReason) {
|
|
|
HDSMediaCallAbilityDisableReasonNone, /// 无
|
|
|
HDSMediaCallAbilityDisableReasonRoomNotOpen, /// 房间未开启
|
|
|
HDSMediaCallAbilityDisableReasonTeacherClose, /// 讲师关闭
|
|
|
HDSMediaCallAbilityDisableReasonLiveEnd, /// 直播结束
|
|
|
HDSMediaCallAbilityDisableReasonLiveBan, /// 直播封禁
|
|
|
HDSMediaCallAbilityDisableReasonNotNetwork, /// 无网络
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### HDSMediaCallAbilityDisableReason
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------------------------------------- | ---------- |
|
|
|
| HDSMediaCallAbilityDisableReasonNone | 无 |
|
|
|
| HDSMediaCallAbilityDisableReasonRoomNotOpen | 房间未开启 |
|
|
|
| HDSMediaCallAbilityDisableReasonTeacherClose | 讲师关闭 |
|
|
|
| HDSMediaCallAbilityDisableReasonLiveEnd | 直播结束 |
|
|
|
| HDSMediaCallAbilityDisableReasonLiveBan | 直播封禁 |
|
|
|
| HDSMediaCallAbilityDisableReasonNotNetwork | 无网络 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 连麦功能不可用原因
|
|
|
typedef NS_ENUM(NSUInteger, HDSMediaCallAbilityDisableReason) {
|
|
|
HDSMediaCallAbilityDisableReasonNone, /// 无
|
|
|
HDSMediaCallAbilityDisableReasonRoomNotOpen, /// 房间未开启
|
|
|
HDSMediaCallAbilityDisableReasonTeacherClose, /// 讲师关闭
|
|
|
HDSMediaCallAbilityDisableReasonLiveEnd, /// 直播结束
|
|
|
HDSMediaCallAbilityDisableReasonLiveBan, /// 直播封禁
|
|
|
HDSMediaCallAbilityDisableReasonNotNetwork, /// 无网络
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### HDSStreamModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------- | ----------------------------------- |
|
|
|
| hds_remoteView | 远端流视图 |
|
|
|
| userInfo | 用户信息 (HDSStreamUserInfoModel) |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 远端流视图
|
|
|
@property (nonatomic, strong) UIView * _Nonnull hds_remoteView;
|
|
|
|
|
|
@property (nonatomic, strong) HDSStreamUserInfoModel * _Nonnull userInfo;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### HDSStreamUserInfoModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------------- | --------------------- |
|
|
|
| userId | 用户ID |
|
|
|
| userName | 用户名 |
|
|
|
| userRole | 用户角色 (0 :老师) |
|
|
|
| isAudioEnable | 声音是否可用 |
|
|
|
| isVideoEnable | 视频是否可用 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 用户ID
|
|
|
@property (nonatomic, copy) NSString * _Nullable userId;
|
|
|
/// 用户名
|
|
|
@property (nonatomic, copy) NSString * _Nonnull userName;
|
|
|
/// 用户角色
|
|
|
@property (nonatomic, assign) NSInteger userRole;
|
|
|
/// 声音是否可用
|
|
|
@property (nonatomic, assign) BOOL isAudioEnable;
|
|
|
/// 视频是否可用
|
|
|
@property (nonatomic, assign) BOOL isVideoEnable;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### HDSOnErrorModel
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------- | -------- |
|
|
|
| type | 错误类型 |
|
|
|
| message | 错误信息 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/// 错误类型
|
|
|
@property (nonatomic, assign) OnErrorType type;
|
|
|
/// 错误信息
|
|
|
@property (nonatomic, copy) NSString * _Nullable message;
|
|
|
|
|
|
typedef NS_ENUM(NSInteger, OnErrorType) {
|
|
|
OnErrorType_LoginFailed = 2001001001, // 登陆失败
|
|
|
OnErrorType_GetPlaySourceFailed = 2001001002, // 获取播放源失败
|
|
|
OnErrorType_GetSummaryFailed = 2001001003, // 获取摘要失败
|
|
|
};
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#### 参数变更
|
|
|
|
|
|
##### viewerCustomua
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| -------------- | ------------------------------------------------------------ |
|
|
|
| viewerCustomua | 用户自定义参数,需和后台协商,没有定制传@"" 长度不能超过40个字符 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 用户自定义参数,需和后台协商,没有定制传@"" 长度不能超过40个字符
|
|
|
*/
|
|
|
@property(nonatomic, copy)NSString *viewerCustomua;
|
|
|
```
|
|
|
|
|
|
##### viewercustominfo
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ---------------- | ------------------------------------------------------------ |
|
|
|
| viewercustominfo | json格式字符串,可选,自定义用户信息,该信息会记录在用户访问记录中,用于统计分析使用(长度不能超过200个字符,若直播间启用接口验证则该参数无效)如果不需要的话就不要传值 |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* json格式字符串,可选,自定义用户信息,该信息会记录在用户访问记录中,用于统计分析使用(长度不能超过200个字符,若直播间启用接口验证则该参数无效)如果不需要的话就不要传值
|
|
|
* 格式如下:
|
|
|
* viewercustominfo: '{"exportInfos": [ {"key": "城市", "value": "北京"}, {"key": "姓名", "value": "哈哈"}]}'
|
|
|
*/
|
|
|
@property(nonatomic, copy)NSString *viewercustominfo;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
#### 已删除参数
|
|
|
|
|
|
##### ~~playerParent~~
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ---------------- | -------------------------- |
|
|
|
| ~~playerParent~~ | ~~视频父类窗口(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频父类窗口(已删除)
|
|
|
*/
|
|
|
@property(nonatomic, strong) UIView *playerParent;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~playerFrame~~
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| --------------- | ---------------------- |
|
|
|
| ~~playerFrame~~ | ~~视频区域(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 视频区域(已删除)
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGRect playerFrame;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~security~~
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ------------ | --------------------------- |
|
|
|
| ~~security~~ | ~~是否使用https(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 是否使用https(已删除)
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL security;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
##### ~~liveId~~
|
|
|
|
|
|
| 参数 | 注释 |
|
|
|
| ---------- | ---------------------------------- |
|
|
|
| ~~liveId~~ | ~~直播ID,回放时才用到(已删除)~~ |
|
|
|
|
|
|
示例代码
|
|
|
|
|
|
```objc
|
|
|
/**
|
|
|
* @brief 直播ID,回放时才用到(已删除)
|
|
|
*/
|
|
|
@property(nonatomic, copy)NSString *liveId;
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|