|
|
|
|
|
## 1.播放功能
|
|
|
|
|
|
### 1.1 DWVodVideoModel数据模型的使用
|
... | ... | @@ -5,81 +6,136 @@ DWVodVideoModel类是SDK中媒体的数据模型,无论是播放、下载都 |
|
|
|
|
|
以下是具体DWVodVideoModel中,包含的字段及含义:
|
|
|
```
|
|
|
///视频 id
|
|
|
@property (nonatomic, strong, readonly) NSString * videoId;
|
|
|
/**
|
|
|
* @brief 视频id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * videoId;
|
|
|
|
|
|
///视频标题
|
|
|
@property (nonatomic, strong, readonly) NSString * title;
|
|
|
/**
|
|
|
* @brief 视频标题
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * title;
|
|
|
|
|
|
///视频状态 为0代表可用,否则代表不可用。
|
|
|
@property (nonatomic, assign, readonly) NSInteger status;
|
|
|
/**
|
|
|
* @brief 视频状态,0代表可用,否则代表不可用
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger status;
|
|
|
|
|
|
///视频状态描述 若视频不可用,具体描述原因
|
|
|
@property (nonatomic, strong, readonly) NSString * statusInfo;
|
|
|
/**
|
|
|
* @brief 视频状态描述,若视频不可用,具体描述原因
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * statusInfo;
|
|
|
|
|
|
///默认清晰度
|
|
|
@property (nonatomic, strong, readonly) NSString * defaultquality;
|
|
|
/**
|
|
|
* @brief 默认清晰度
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * defaultquality;
|
|
|
|
|
|
///分享URL
|
|
|
@property (nonatomic, strong, readonly) NSString * shareurl;
|
|
|
/**
|
|
|
* @brief 分享URL
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * shareurl;
|
|
|
|
|
|
///视频清晰度
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVideoQualityModel *> * videoQualities;
|
|
|
/**
|
|
|
* @brief 视频清晰度
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoQualityModel *> * videoQualities;
|
|
|
|
|
|
///音频清晰度
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVideoQualityModel *> * radioQualities;
|
|
|
/**
|
|
|
* @brief 音频清晰度
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoQualityModel *> * radioQualities;
|
|
|
|
|
|
///授权验证信息字典
|
|
|
@property (nonatomic, strong, readonly) DWVideoAuthorizeModel * authorize;
|
|
|
/**
|
|
|
* @brief 授权验证信息字典
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoAuthorizeModel * authorize;
|
|
|
|
|
|
///是否原片播放
|
|
|
@property (nonatomic, assign, readonly) BOOL isRealTime;
|
|
|
/**
|
|
|
* @brief 是否原片播放
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isRealTime;
|
|
|
|
|
|
///是否支持VR 1表示播放VR视频,0表示普通
|
|
|
@property (nonatomic, assign, readonly) NSInteger vrmode;
|
|
|
/**
|
|
|
* @brief 是否支持VR,1表示播放VR视频,0表示普通
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger vrmode;
|
|
|
|
|
|
///视频打点数据
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVideoMarkModel *> * videomarks;
|
|
|
/**
|
|
|
* @brief 视频打点数据
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoMarkModel *> * videomarks;
|
|
|
|
|
|
///视频问答数据
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVideoQuestionModel *> * questions;
|
|
|
/**
|
|
|
* @brief 视频问答数据
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoQuestionModel *> * questions;
|
|
|
|
|
|
//字幕
|
|
|
///取值含义 -1 无字幕 ,0:subtitle, 1:subtitle2, 2:双语
|
|
|
@property (nonatomic, assign, readonly) NSInteger defaultSubtitle;
|
|
|
/**
|
|
|
* @brief 字幕类型,-1 无字幕 ,0 subtitle, 1 subtitle2, 2 双语
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger defaultSubtitle;
|
|
|
|
|
|
///字幕1
|
|
|
@property (nonatomic, strong, readonly) DWVideoSubtitleModel * subtitle;
|
|
|
/**
|
|
|
* @brief 字幕1
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoSubtitleModel * subtitle;
|
|
|
|
|
|
///字幕2
|
|
|
@property (nonatomic, strong, readonly) DWVideoSubtitleModel * subtitle2;
|
|
|
/**
|
|
|
* @brief 字幕2
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoSubtitleModel * subtitle2;
|
|
|
|
|
|
///访客信息收集
|
|
|
@property (nonatomic, strong, readonly) DWVideoVisitorModel * visitor;
|
|
|
/**
|
|
|
* @brief 访客信息收集
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoVisitorModel * visitor;
|
|
|
|
|
|
///课堂练习
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVideoExercisesModel *> * exercises;
|
|
|
/**
|
|
|
* @brief 课堂练习
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoExercisesModel *> * exercises;
|
|
|
|
|
|
@property (nonatomic, assign, readonly)int reason;
|
|
|
/**
|
|
|
* @brief reason
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int reason;
|
|
|
|
|
|
@property (nonatomic, strong, readonly)NSDate * responseTime;
|
|
|
/**
|
|
|
* @brief responseTime
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSDate * responseTime;
|
|
|
|
|
|
@property (nonatomic, strong, readonly)NSDate * startTime;
|
|
|
/**
|
|
|
* @brief startTime
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSDate * startTime;
|
|
|
|
|
|
/**
|
|
|
* @brief cc账号id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * CCUserId;
|
|
|
|
|
|
///cc账号id
|
|
|
@property (nonatomic, strong, readonly) NSString * CCUserId;
|
|
|
/**
|
|
|
* @brief cc账号key
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * CCApiKey;
|
|
|
|
|
|
///cc账号key
|
|
|
@property (nonatomic, strong, readonly) NSString * CCApiKey;
|
|
|
/**
|
|
|
* @brief 是否支持hls
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL hlsSupport;
|
|
|
|
|
|
///是否支持hls
|
|
|
@property (nonatomic, assign, readonly) BOOL hlsSupport;
|
|
|
/**
|
|
|
* @brief UPID
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * UPID;
|
|
|
|
|
|
///UPID
|
|
|
@property (nonatomic, strong, readonly) NSString * UPID;
|
|
|
/**
|
|
|
* @brief token
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * token;
|
|
|
|
|
|
///token
|
|
|
@property (nonatomic, strong, readonly) NSString * token;
|
|
|
```
|
|
|
|
|
|
## 1.2 播放功能集成
|
... | ... | @@ -91,304 +147,358 @@ DWPlayerView是SDK的播放视图,可以通过创建此对象,添加到需 |
|
|
DWPlayerView包含的属性及方法如下:
|
|
|
|
|
|
```
|
|
|
|
|
|
/**
|
|
|
播放属性
|
|
|
* @brief 播放属性
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)AVPlayer *player;
|
|
|
|
|
|
/**
|
|
|
播放图层
|
|
|
* @brief 播放图层
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)AVPlayerLayer *playerLayer;
|
|
|
|
|
|
/**
|
|
|
代理
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak)id<DWVideoPlayerDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
AVPlayerLayer的videoGravity属性设置
|
|
|
AVLayerVideoGravityResize, // 非均匀模式。两个维度完全填充至整个视图区域
|
|
|
AVLayerVideoGravityResizeAspect, // 等比例填充,直到一个维度到达区域边界
|
|
|
AVLayerVideoGravityResizeAspectFill, // 等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪
|
|
|
* @brief 视频填充模式,默认AVLayerVideoGravityResizeAspect
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString *videoGravity;
|
|
|
|
|
|
/**
|
|
|
//是否正在播放
|
|
|
* @brief 当前播放状态
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)BOOL playing;
|
|
|
|
|
|
/**
|
|
|
是否循环播放 默认为NO
|
|
|
* @brief 是否循环播放,默认为NO
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL looping;
|
|
|
|
|
|
/**
|
|
|
是否静音 默认为NO
|
|
|
* @brief 是否静音,默认为NO
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL muted;
|
|
|
|
|
|
/**
|
|
|
视频加载超时时间 默认30s
|
|
|
* @brief 视频加载超时时间,默认30s
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGFloat timeOutLoad;
|
|
|
|
|
|
/**
|
|
|
缓存超时时间 默认30s
|
|
|
* @brief 缓存超时时间,默认30s
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGFloat timeOutBuffer;
|
|
|
|
|
|
/**
|
|
|
缓冲模式 默认DWPlayerViewLoadStyleDefault
|
|
|
* @brief 缓冲模式 默认DWPlayerViewLoadStyleDefault
|
|
|
*/
|
|
|
@property(nonatomic,assign)DWPlayerViewLoadStyle loadStyle;
|
|
|
|
|
|
/**
|
|
|
是否开启防录屏模式,默认为NO。
|
|
|
注意:此属性仅针对iOS11以上系统生效。
|
|
|
* @brief 是否开启防录屏模式,默认为NO。仅对iOS11以上系统生效
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL videoProtect;
|
|
|
|
|
|
/**
|
|
|
期待缓冲时长 默认 0,建议取值1 ~ 50 。
|
|
|
注意:此属性仅针对iOS10以上系统, m3u8格式视频有效。
|
|
|
* @brief 期待缓冲时长,默认0,建议取值1 ~ 50。仅对iOS10以上系统,m3u8格式视频有效
|
|
|
*/
|
|
|
|
|
|
@property(nonatomic,assign)NSTimeInterval forwardBufferDuration;
|
|
|
|
|
|
/**
|
|
|
是否是备用线路
|
|
|
* @brief 是否是备用线路
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)BOOL isSpar;
|
|
|
|
|
|
/**
|
|
|
当前正在播放的媒体清晰度model,非在线视频返回nil。注意,在调用playVodViedo:withCustomId:方法后才可获取到此属性
|
|
|
* @brief 当前正在播放的媒体清晰度model,非在线视频返回nil。注意,在调用playVodViedo:withCustomId:方法后才可获取到此属性
|
|
|
*/
|
|
|
@property (nonatomic,strong,readonly) DWVideoQualityModel * qualityModel;
|
|
|
@property(nonatomic,strong,readonly)DWVideoQualityModel * qualityModel;
|
|
|
|
|
|
/**
|
|
|
返回当前播放的离线model,在线视频返回nil。注意,在调用playLocalVideo:方法后才可获取到此属性。
|
|
|
* @brief 返回当前播放的离线model,在线视频返回nil。注意,在调用playLocalVideo:方法后才可获取到此属性
|
|
|
*/
|
|
|
@property (nonatomic,strong,readonly) DWDownloadModel * downloadModel;
|
|
|
@property(nonatomic,strong,readonly)DWDownloadModel * downloadModel;
|
|
|
|
|
|
/**
|
|
|
当前播放时长
|
|
|
* @brief 当前播放时长
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval playedTimes;
|
|
|
|
|
|
/**
|
|
|
当前暂停时长
|
|
|
*/
|
|
|
* @brief 当前暂停时长
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval pausedTimes;
|
|
|
|
|
|
/**
|
|
|
单例
|
|
|
|
|
|
@return 单例对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化播放对象
|
|
|
* @discussion 以单例的形式,初始化播放对象
|
|
|
* @result DWPlayerView对象
|
|
|
*/
|
|
|
+ (instancetype)sharedInstance;
|
|
|
+(instancetype)sharedInstance;
|
|
|
|
|
|
/**
|
|
|
初始化播放对象
|
|
|
@return DWPlayerView
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化播放对象
|
|
|
* @discussion 初始化播放对象
|
|
|
* @result DWPlayerView对象
|
|
|
*/
|
|
|
-(instancetype)init;
|
|
|
|
|
|
/**
|
|
|
初始化播放对象
|
|
|
@param frame
|
|
|
@return DWPlayerView
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化播放对象
|
|
|
* @discussion 初始化播放对象
|
|
|
* @param frame 视图frame
|
|
|
* @result DWPlayerView对象
|
|
|
*/
|
|
|
-(instancetype)initWithFrame:(CGRect)frame;
|
|
|
|
|
|
/**
|
|
|
播放网络视频 , 播放默认清晰度,对于在线媒体,必须要执行此方法,否则会导致数据统计缺失
|
|
|
@param videoModel 视频model
|
|
|
@param customId 用户自定义参数 有自定义统计参数需求/流量统计的客户必须传值,没有此需求的客户请传nil
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 播放网络视频
|
|
|
* @discussion 播放默认清晰度,对于在线媒体,必须要执行此方法,否则会导致数据统计缺失
|
|
|
* @param videoModel 在线视频model
|
|
|
* @param customId 用户自定义参数,有自定义统计参数需求/流量统计的客户必须传值,没有此需求的客户请传nil
|
|
|
*/
|
|
|
-(void)playVodViedo:(DWVodVideoModel *)videoModel withCustomId:(NSString *)customId;
|
|
|
|
|
|
/**
|
|
|
播放本地视频
|
|
|
@param downloadModel 下载model
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 播放本地视频
|
|
|
* @discussion 播放本地视频
|
|
|
* @param downloadModel 离线视频model
|
|
|
*/
|
|
|
-(void)playLocalVideo:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
切换清晰度方法
|
|
|
@param qualitiyModel 清晰度model
|
|
|
@param customId 用户自定义参数 有自定义统计参数需求/流量统计的客户必须传值,没有此需求的客户请传nil
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 切换清晰度方法
|
|
|
* @discussion 切换清晰度方法
|
|
|
* @param qualitiyModel 清晰度model
|
|
|
* @param customId 用户自定义参数,有自定义统计参数需求/流量统计的客户必须传值,没有此需求的客户请传nil
|
|
|
*/
|
|
|
-(void)switchQuality:(DWVideoQualityModel *)qualitiyModel withCustomId:(NSString *)customId;
|
|
|
|
|
|
/**
|
|
|
切换备用线路 切换当前清晰度下的备用线路
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 切换备用线路
|
|
|
* @discussion 切换当前清晰度下的备用线路
|
|
|
*/
|
|
|
-(void)switchSparPlayLine;
|
|
|
|
|
|
/**
|
|
|
设置是否允许后台播放,目前只支持音频后台播放
|
|
|
@param play 是否允许后台播放
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 后台播放功能
|
|
|
* @discussion 开启/关闭后台播放功能
|
|
|
* @param play 是否允许后台播放
|
|
|
*/
|
|
|
-(void)setPlayInBackground:(BOOL)play;
|
|
|
|
|
|
- (void)setPlayInBackground:(BOOL)play;
|
|
|
|
|
|
/**
|
|
|
设置是否画中画模式
|
|
|
|
|
|
@param play 是否画中画模式
|
|
|
*/
|
|
|
- (void)setPictureInPicture:(BOOL)openPIP API_AVAILABLE(ios(9.0));
|
|
|
|
|
|
/**
|
|
|
切换倍速
|
|
|
@param rate 速率
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 画中画功能
|
|
|
* @discussion 开启/关闭画中画功能
|
|
|
* @param openPIP 是否开启画中画功能
|
|
|
*/
|
|
|
- (void)setPlayerRate:(float)rate;
|
|
|
-(void)setPictureInPicture:(BOOL)openPIP API_AVAILABLE(ios(9.0));
|
|
|
|
|
|
/**
|
|
|
重复播放当前媒体
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 切换倍速
|
|
|
* @discussion 切换倍速
|
|
|
* @param rate 倍速速率
|
|
|
*/
|
|
|
- (void)repeatPlay;
|
|
|
-(void)setPlayerRate:(float)rate;
|
|
|
|
|
|
/**
|
|
|
播放
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 重复播放当前媒体
|
|
|
* @discussion 重复播放当前媒体
|
|
|
*/
|
|
|
- (void)play;
|
|
|
-(void)repeatPlay;
|
|
|
|
|
|
/**
|
|
|
暂停
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 播放
|
|
|
* @discussion 播放当前媒体资源
|
|
|
*/
|
|
|
- (void)pause;
|
|
|
-(void)play;
|
|
|
|
|
|
/**
|
|
|
拖到XX秒播放视频,在AVPlayerItemStatusReadyToPlay即状态处于可播放后 才会有效果
|
|
|
@param time 跳转时间
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 暂停
|
|
|
* @discussion 暂停当前媒体资源
|
|
|
*/
|
|
|
- (void)scrub:(float)time;
|
|
|
-(void)pause;
|
|
|
|
|
|
/**
|
|
|
精确拖拽到XX秒播放视频,在AVPlayerItemStatusReadyToPlay即状态处于可播放后 才会有效果
|
|
|
@param time 跳转时间
|
|
|
@param completion 跳转完成回调
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 拖到XX秒播放视频
|
|
|
* @discussion 在AVPlayerItemStatusReadyToPlay即状态处于可播放后,拖拽生效
|
|
|
* @param time 跳转时间
|
|
|
*/
|
|
|
-(void)scrubPrecise:(float)time CompletionHandler:(void(^)(BOOL finished))completion;
|
|
|
-(void)scrub:(float)time;
|
|
|
|
|
|
/**
|
|
|
记录播放位置的方法(只为记忆播放功能使用 其它地方请调用scrub / scrubPrecise方法),在AVPlayerItemStatusReadyToPlay即状态处于可播放后 才会有效果
|
|
|
@param time 跳转时间
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 拖到XX秒播放视频
|
|
|
* @discussion 在AVPlayerItemStatusReadyToPlay即状态处于可播放后,拖拽生效
|
|
|
* @param time 跳转时间
|
|
|
* @param completion 跳转完成回调
|
|
|
*/
|
|
|
- (void)oldTimeScrub:(float)time;
|
|
|
-(void)scrubPrecise:(float)time CompletionHandler:(void(^)(BOOL finished))completion;
|
|
|
|
|
|
/**
|
|
|
设置音量
|
|
|
@param volume 音量
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 记录播放位置的方法
|
|
|
* @discussion 只为记忆播放功能使用,其它地方请调用scrub / scrubPrecise方法,在AVPlayerItemStatusReadyToPlay即状态处于可播放后 才会有效果
|
|
|
* @param time 跳转时间
|
|
|
*/
|
|
|
- (void)setVolume:(float)volume;
|
|
|
-(void)oldTimeScrub:(float)time;
|
|
|
|
|
|
/**
|
|
|
加大音量
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置音量
|
|
|
* @discussion 设置音量
|
|
|
* @param volume 音量
|
|
|
*/
|
|
|
- (void)fadeInVolume;
|
|
|
-(void)setVolume:(float)volume;
|
|
|
|
|
|
/**
|
|
|
减小音量
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 加大音量
|
|
|
* @discussion 加大音量
|
|
|
*/
|
|
|
- (void)fadeOutVolume;
|
|
|
-(void)fadeInVolume;
|
|
|
|
|
|
/**
|
|
|
关闭|释放播放资源
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 减小音量
|
|
|
* @discussion 减小音量
|
|
|
*/
|
|
|
- (void)resetPlayer;
|
|
|
-(void)fadeOutVolume;
|
|
|
|
|
|
/**
|
|
|
停止视频播放统计 播放页面关闭时务必调用removeTimer方法
|
|
|
注意:播放页面关闭时 如需释放资源 调用方式如下{
|
|
|
[playerView removeTimer];
|
|
|
[playerView resetPlayer];
|
|
|
|
|
|
}
|
|
|
|
|
|
如无需释放播放资源 调用方式如下{
|
|
|
[playerView removeTimer];
|
|
|
[playerView pause];
|
|
|
}
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 关闭|释放播放资源
|
|
|
* @discussion 关闭|释放播放资源
|
|
|
*/
|
|
|
- (void)removeTimer;
|
|
|
-(void)resetPlayer;
|
|
|
|
|
|
// AirPlay技术 外部播放设置
|
|
|
/**
|
|
|
支持AirPlay外部播放 默认支持
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 停止视频播放统计
|
|
|
* @discussion 播放页面关闭时务必调用removeTimer方法 注意:播放页面关闭时 如需释放资源 调用方式如下{
|
|
|
[playerView removeTimer];
|
|
|
[playerView resetPlayer];
|
|
|
}
|
|
|
如无需释放播放资源 调用方式如下{
|
|
|
[playerView removeTimer];
|
|
|
[playerView pause];
|
|
|
}
|
|
|
*/
|
|
|
- (void)enableAirplay;
|
|
|
-(void)removeTimer;
|
|
|
|
|
|
/**
|
|
|
不支持AirPlay外部播放
|
|
|
//AirPlay技术 外部播放设置
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 支持AirPlay外部播放
|
|
|
* @discussion 默认支持
|
|
|
*/
|
|
|
- (void)disableAirplay;
|
|
|
|
|
|
/**
|
|
|
检测是否支持支持AirPlay外部播放
|
|
|
-(void)enableAirplay;
|
|
|
|
|
|
@return BOOL
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 不支持AirPlay外部播放
|
|
|
* @discussion 不支持AirPlay外部播放
|
|
|
*/
|
|
|
- (BOOL)isAirplayEnabled;
|
|
|
-(void)disableAirplay;
|
|
|
|
|
|
|
|
|
/**
|
|
|
获取可播放的持续时间
|
|
|
@return 可播放的持续时间
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 检测是否支持支持AirPlay外部播放
|
|
|
* @discussion 检测是否支持支持AirPlay外部播放
|
|
|
* @result 检测结果
|
|
|
*/
|
|
|
- (NSTimeInterval )playableDuration;
|
|
|
-(BOOL)isAirplayEnabled;
|
|
|
|
|
|
/**
|
|
|
获取当前player播放的URL 可用于截图
|
|
|
@return 当前播放URL
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 播放器截图
|
|
|
* @discussion 获取播放器在当前时间点的截图
|
|
|
* @result 图片对象
|
|
|
*/
|
|
|
-(NSURL *)urlOfCurrentlyPlayingInPlayer;
|
|
|
-(UIImage *)screenShot;
|
|
|
|
|
|
/**
|
|
|
获取用来做GIF功能的URL 加密调用
|
|
|
@return URL
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取可播放的持续时间
|
|
|
* @discussion 获取可播放的持续时间
|
|
|
* @result 可播放的持续时间
|
|
|
*/
|
|
|
- (NSURL *)drmGIFURL;
|
|
|
-(NSTimeInterval)playableDuration;
|
|
|
|
|
|
/**
|
|
|
获取用来做GIF功能的URL 非加密调用
|
|
|
@return URL
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取当前player播放的URL
|
|
|
* @discussion 可用于截图
|
|
|
* @result 当前播放URL
|
|
|
*/
|
|
|
- (NSURL *)unDrmGIFURL;
|
|
|
|
|
|
/**
|
|
|
问答统计 有此需求的客户调用 一个问题只发送一次
|
|
|
@param videoId 视频ID
|
|
|
@param questionId 问题ID
|
|
|
@param answerId 用户选择的选项ID,以逗号分隔多个选项ID。
|
|
|
如1345是单选 2067,3092,4789是多选
|
|
|
@param status YES正确 NO错误
|
|
|
*/
|
|
|
- (void)reportQuestionWithVideoId:(NSString *)videoId questionId:(NSString *)questionId answerId:(NSString *)answerId status:(BOOL )status;
|
|
|
-(NSURL *)urlOfCurrentlyPlayingInPlayer;
|
|
|
|
|
|
/**
|
|
|
访客信息统计上报 有此需求的客户调用
|
|
|
|
|
|
@param visitorId 访客信息收集器ID 必填
|
|
|
@param videoId 视频ID 必填
|
|
|
@param userId CC账号ID 必填
|
|
|
@param message 上报信息 必填 具体格式详见demo
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取用来做GIF功能的URL
|
|
|
* @discussion 加密调用
|
|
|
* @result 当前播放URL
|
|
|
*/
|
|
|
-(NSURL *)drmGIFURL;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取用来做GIF功能的URL
|
|
|
* @discussion 非加密调用
|
|
|
* @result 当前播放URL
|
|
|
*/
|
|
|
-(NSURL *)unDrmGIFURL;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 问答统计
|
|
|
* @discussion 有此需求的客户调用,一个问题只发送一次
|
|
|
* @param videoId 视频ID
|
|
|
* @param questionId 问题ID
|
|
|
* @param answerId 用户选择的选项ID,以逗号分隔多个选项ID,如1345是单选 2067,3092,4789是多选
|
|
|
* @param status YES正确 NO错误
|
|
|
*/
|
|
|
-(void)reportQuestionWithVideoId:(NSString *)videoId questionId:(NSString *)questionId answerId:(NSString *)answerId status:(BOOL)status;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 访客信息统计上报
|
|
|
* @discussion 有此需求的客户调用
|
|
|
* @param visitorId 访客信息收集器ID,必填
|
|
|
* @param videoId 视频ID,必填
|
|
|
* @param userId CC账号ID,必填
|
|
|
* @param message 上报信息,必填,具体格式详见demo
|
|
|
*/
|
|
|
-(void)reportVisitorCollectWithVisitorId:(NSString *)visitorId VideoId:(NSString *)videoId UserId:(NSString *)userId AndMessage:(NSString *)message;
|
|
|
|
|
|
/**
|
|
|
课堂练习统计上报 有此需求的客户调用
|
|
|
|
|
|
@param exercisesId 课堂练习ID 必填
|
|
|
@param videoId 视频ID 必填
|
|
|
@param userId CC账号ID 必填
|
|
|
@param questionMes 上报信息 必填 具体格式详见demo
|
|
|
@param completion 完成回调,返回课堂练习结果
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 课堂练习统计上报
|
|
|
* @discussion 有此需求的客户调用
|
|
|
* @param exercisesId 课堂练习ID,必填
|
|
|
* @param videoId 视频ID,必填
|
|
|
* @param userId CC账号ID,必填
|
|
|
* @param questionMes 上报信息,必填,具体格式详见demo
|
|
|
* @param completion 完成回调,返回课堂练习结果
|
|
|
*/
|
|
|
-(void)reportExercisesWithExercisesId:(NSString *)exercisesId videoId:(NSString *)videoId UserId:(NSString *)userId QuestionMes:(NSString *)questionMes AndCompletion:(void (^)(NSArray * resultArray,NSError * error))completion;
|
|
|
|
|
|
```
|
... | ... | @@ -398,33 +508,55 @@ DWPlayerViewDelegate是DWPlayerView的代理方法,包含了一系列的播放 |
|
|
|
|
|
DWPlayerViewDelegate方法及含义如下:
|
|
|
```
|
|
|
//所有的代理方法均已回到主线程 可直接刷新UI
|
|
|
//可播放
|
|
|
- (void)videoPlayerIsReadyToPlayVideo:(DWPlayerView *)playerView;
|
|
|
/** 可播放
|
|
|
@param playerView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerIsReadyToPlayVideo:(DWPlayerView *)playerView;
|
|
|
|
|
|
//播放完毕
|
|
|
- (void)videoPlayerDidReachEnd:(DWPlayerView *)playerView;
|
|
|
/** 播放完毕
|
|
|
@param playerView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerDidReachEnd:(DWPlayerView *)playerView;
|
|
|
|
|
|
//播放中 time:当前播放时间
|
|
|
- (void)videoPlayer:(DWPlayerView *)playerView timeDidChange:(float)time;
|
|
|
/** 获取播放进度
|
|
|
@param playerView 自身对象
|
|
|
@param time 当前播放时间
|
|
|
*/
|
|
|
-(void)videoPlayer:(DWPlayerView *)playerView timeDidChange:(float)time;
|
|
|
|
|
|
//duration 当前缓冲的长度
|
|
|
- (void)videoPlayer:(DWPlayerView *)playerView loadedTimeRangeDidChange:(float)duration;
|
|
|
/** 获取缓冲进度
|
|
|
@param playerView 自身对象
|
|
|
@param duration 当前缓冲进度
|
|
|
*/
|
|
|
-(void)videoPlayer:(DWPlayerView *)playerView loadedTimeRangeDidChange:(float)duration;
|
|
|
|
|
|
//没数据 即播放卡顿
|
|
|
- (void)videoPlayerPlaybackBufferEmpty:(DWPlayerView *)playerView;
|
|
|
/** 播放器缓存不足,播放卡顿
|
|
|
@param playerView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerPlaybackBufferEmpty:(DWPlayerView *)playerView;
|
|
|
|
|
|
//有数据 能够继续播放
|
|
|
- (void)videoPlayerPlaybackLikelyToKeepUp:(DWPlayerView *)playerView;
|
|
|
/** 播放器缓存充足,可继续播放
|
|
|
@param playerView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerPlaybackLikelyToKeepUp:(DWPlayerView *)playerView;
|
|
|
|
|
|
//加载超时/scrub超时
|
|
|
- (void)videoPlayer:(DWPlayerView *)playerView receivedTimeOut:(DWPlayerViewTimeOut )timeOut;
|
|
|
/** 加载超时/scrub超时
|
|
|
@param playerView 自身对象
|
|
|
@param timeOut 超时类型
|
|
|
*/
|
|
|
-(void)videoPlayer:(DWPlayerView *)playerView receivedTimeOut:(DWPlayerViewTimeOut )timeOut;
|
|
|
|
|
|
//加载失败
|
|
|
- (void)videoPlayer:(DWPlayerView *)playerView didFailWithError:(NSError *)error;
|
|
|
/** 加载失败
|
|
|
@param playerView 自身对象
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)videoPlayer:(DWPlayerView *)playerView didFailWithError:(NSError *)error;
|
|
|
|
|
|
//AVPlayerLayer对象发生改变时回调
|
|
|
- (void)videoPlayer:(DWPlayerView *)playerView ChangePlayerLayer:(AVPlayerLayer *)playerLayer;
|
|
|
/** AVPlayerLayer对象发生改变时回调
|
|
|
@param playerView 自身对象
|
|
|
@param playerLayer 新的AVPlayerLayer对象
|
|
|
*/
|
|
|
-(void)videoPlayer:(DWPlayerView *)playerView ChangePlayerLayer:(AVPlayerLayer *)playerLayer;
|
|
|
```
|
|
|
|
|
|
### 1.2.4 DWPlayerSkinView的使用
|
... | ... | @@ -433,117 +565,117 @@ DWPlayerViewDelegate方法及含义如下: |
|
|
DWPlayerSkinView包含的属性及方法如下:
|
|
|
```
|
|
|
/**
|
|
|
delegate
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak) id<DWPlayerSkinViewDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
当期视频标题
|
|
|
* @brief 当期视频标题
|
|
|
*/
|
|
|
@property(nonatomic,strong)NSString * title;
|
|
|
|
|
|
/**
|
|
|
在线视频model
|
|
|
* @brief 在线视频model
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)DWVodVideoModel * videoModel;
|
|
|
|
|
|
/**
|
|
|
离线视频model
|
|
|
* @brief 离线视频model
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)DWDownloadModel * downloadModel;
|
|
|
|
|
|
/**
|
|
|
DWPlayerView 对象
|
|
|
* @brief DWPlayerView 对象
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)DWPlayerView * player;
|
|
|
|
|
|
/**
|
|
|
用户自定义参数 有自定义统计参数需求/流量统计的客户必须传值
|
|
|
没有此需求的客户请传nil
|
|
|
在不需要统计的地方均传nil 譬如广告视频
|
|
|
* @brief 用户自定义参数 有自定义统计参数需求/流量统计的客户必须传值
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * customId;
|
|
|
|
|
|
/**
|
|
|
AVLayerVideoGravityResize, // 非均匀模式。两个维度完全填充至整个视图区域
|
|
|
AVLayerVideoGravityResizeAspect, // 等比例填充,直到一个维度到达区域边界
|
|
|
AVLayerVideoGravityResizeAspectFill, // 等比例填充,直到填充满整个视图区域,其中一个维度的部分区域会被裁剪
|
|
|
* @brief 视频填充模式,默认AVLayerVideoGravityResizeAspect
|
|
|
*/
|
|
|
@property(nonatomic,strong)NSString * videoGravity;
|
|
|
|
|
|
/**
|
|
|
宽高比 默认是4:3
|
|
|
若需改变view的大小,请设置此属性,不要直接设置frame
|
|
|
* @brief 宽高比 默认是4:3,若需改变view的大小,请设置此属性,不要直接设置frame
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGFloat screenScale;
|
|
|
|
|
|
/**
|
|
|
是否在播放中 YES 正在播放,NO 暂停播放
|
|
|
* @brief 是否在播放中,YES 正在播放,NO 暂停播放
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)BOOL isPlaying;
|
|
|
|
|
|
/**
|
|
|
当前是否全屏 YES 全屏,NO 非全屏
|
|
|
* @brief 当前是否全屏,YES 全屏,NO 非全屏
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)BOOL isFull;
|
|
|
|
|
|
/**
|
|
|
当前播放倍速 默认 1
|
|
|
* @brief 当前播放倍速,默认1
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)CGFloat speed;
|
|
|
|
|
|
/**
|
|
|
当期播放媒体是否是视频 YES 视频,NO 音频
|
|
|
* @brief 当期播放媒体是否是视频,YES 视频,NO 音频
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)BOOL isPlayVideo;
|
|
|
|
|
|
/**
|
|
|
媒体总时长 收到videoPlayerSkinReadyToPlay回调以后 生效
|
|
|
* @brief 媒体总时长,收到videoPlayerSkinReadyToPlay回调以后生效
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval totalDuration;
|
|
|
|
|
|
/**
|
|
|
当前播放时间
|
|
|
* @brief 当前播放时间
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval currentDuration;
|
|
|
|
|
|
/**
|
|
|
当前缓冲时间 只对在线视频有效,离线视频为0
|
|
|
* @brief 当前缓冲时间,只对在线视频有效,离线视频为0
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval bufferDuration;
|
|
|
|
|
|
/**
|
|
|
媒体播放的起始位置
|
|
|
如果设置此值 收到videoPlayerSkinReadyToPlay回调以后,会自动跳转到当前进度,包括切换清晰度时,也会拖拽到此。 默认为0
|
|
|
* @brief 媒体播放的起始位置,默认为0,如果设置此值 收到videoPlayerSkinReadyToPlay回调以后,会自动跳转到当前进度,包括切换清晰度时,也会拖拽到此
|
|
|
*/
|
|
|
@property(nonatomic,assign)NSTimeInterval scrubPosition;
|
|
|
|
|
|
/**
|
|
|
是否允许自动旋转 默认YES ,若设置NO,屏幕旋转时,将不会改变view的大小
|
|
|
* @brief 是否允许自动旋转,默认YES,若设置NO,屏幕旋转时,将不会改变view的大小
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL allowAutoRotate;
|
|
|
|
|
|
/**
|
|
|
播放器默认横竖屏状态设置
|
|
|
仅在自动旋转功能关闭的情况下生效 会强制转换屏幕,需跟allowAutoRotate搭配使用。 默认YES,竖屏模式
|
|
|
* @brief 播放器默认横竖屏状态设置,仅在自动旋转功能关闭的情况下生效 会强制转换屏幕,需跟allowAutoRotate搭配使用。 默认YES,竖屏模式
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL isPortraitModel;
|
|
|
|
|
|
/**
|
|
|
初始化方法,请调用此方法,不要调用init,initWithFrame等初始化方法
|
|
|
@return DWPlayerSkinView对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化方法
|
|
|
* @discussion 初始化方法,请调用此方法进行初始化,不要调用init,initWithFrame等初始化方法
|
|
|
* @param time 当前播放时间
|
|
|
* @result DWPlayerSkinView对象
|
|
|
*/
|
|
|
-(instancetype)initSkinView;
|
|
|
|
|
|
/**
|
|
|
设置播放网络视频数据,并开始播放
|
|
|
@param videoModel DWVodVideoModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置播放网络视频数据,并开始播放
|
|
|
* @discussion 设置播放网络视频数据,并开始播放
|
|
|
* @param videoModel DWVodVideoModel对象
|
|
|
*/
|
|
|
-(void)playVodViedo:(DWVodVideoModel *)videoModel;
|
|
|
|
|
|
/**
|
|
|
设置播放本地视频,并开始播放
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置播放本地视频,并开始播放
|
|
|
* @discussion 设置播放本地视频,并开始播放
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)playLocalVideo:(DWDownloadModel *)downloadModel;
|
|
|
```
|
... | ... | @@ -554,32 +686,56 @@ DWPlayerSkinViewDelegate是DWPlayerSkinView的代理方法,包含了一些事 |
|
|
|
|
|
DWPlayerSkinViewDelegate方法及含义如下:
|
|
|
```
|
|
|
//所有的代理方法均已回到主线程 可直接刷新UI
|
|
|
//准备播放
|
|
|
/** 准备播放
|
|
|
@param playerSkinView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerSkinReadyToPlay:(DWPlayerSkinView *)playerSkinView;
|
|
|
|
|
|
//当前播放时长回调
|
|
|
/** 当前播放时长回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param time 当前播放时间
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView timeDidChange:(NSTimeInterval)time;
|
|
|
|
|
|
//媒体播放完毕回调
|
|
|
/** 媒体播放完毕回调
|
|
|
@param playerSkinView 自身对象
|
|
|
*/
|
|
|
-(void)videoPlayerSkinEndToPlay:(DWPlayerSkinView *)playerSkinView;
|
|
|
|
|
|
//开始/暂停事件触发回调
|
|
|
/** 开始/暂停事件触发回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param isPlay 当前播放状态
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView PlayOrPauseAction:(BOOL)isPlay;
|
|
|
|
|
|
//全屏/非全屏旋转回调
|
|
|
/** 全屏/非全屏旋转回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param isScreen 是否全屏状态
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView FullScreenAction:(BOOL)isScreen;
|
|
|
|
|
|
//后退按钮回调 注意:若backPortrait为YES,会清空播放器。
|
|
|
/** 后退按钮回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param backPortrait 后退按钮状态。注意:此值为YES时,会清空播放器
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView ReturnBackAction:(BOOL)backPortrait;
|
|
|
|
|
|
//倍速切换回调
|
|
|
/** 倍速切换回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param speed 当期倍速
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView SpeedSwitchAction:(CGFloat)speed;
|
|
|
|
|
|
//下载事件回调 ,返回当前播放清晰度model
|
|
|
/** 下载事件回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param qualityModel 当前播放清晰度model
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView DownloadAction:(DWVideoQualityModel *)qualityModel;
|
|
|
|
|
|
//错误/警告信息回调
|
|
|
/** 错误/警告信息回调
|
|
|
@param playerSkinView 自身对象
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)videoPlayerSkin:(DWPlayerSkinView *)playerSkinView didFailWithError:(NSError *)error;
|
|
|
```
|
|
|
|
... | ... | @@ -612,11 +768,15 @@ self.playerSkinView.customId = @"传入需要分类的customId"; |
|
|
|
|
|
DWVideoMarkModel数据及含义如下:
|
|
|
```
|
|
|
///打点描述内容
|
|
|
@property (nonatomic, strong, readonly)NSString * markdesc;
|
|
|
/**
|
|
|
* @brief 打点描述内容
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * markdesc;
|
|
|
|
|
|
///打点时间
|
|
|
@property (nonatomic, assign, readonly)NSInteger marktime;
|
|
|
/**
|
|
|
* @brief 打点时间
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger marktime;
|
|
|
```
|
|
|
|
|
|
## 1.5 视频问答
|
... | ... | @@ -624,43 +784,71 @@ DWVideoMarkModel数据及含义如下: |
|
|
|
|
|
DWVideoQuestionModel数据及含义如下:
|
|
|
```
|
|
|
///问答id
|
|
|
@property (nonatomic, strong, readonly)NSString * questionId;
|
|
|
/**
|
|
|
* @brief 问答id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * questionId;
|
|
|
|
|
|
///问答题目描述
|
|
|
@property (nonatomic, strong, readonly)NSString * content;
|
|
|
/**
|
|
|
* @brief 问答题目描述
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * content;
|
|
|
|
|
|
///问答出现时间
|
|
|
@property (nonatomic, assign, readonly)NSInteger showTime;
|
|
|
/**
|
|
|
* @brief 问答出现时间
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger showTime;
|
|
|
|
|
|
///答案解释
|
|
|
@property (nonatomic, strong, readonly)NSString * explainInfo;
|
|
|
/**
|
|
|
* @brief 答案解释
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * explainInfo;
|
|
|
|
|
|
///是否允许跳过
|
|
|
@property (nonatomic, assign, readonly)BOOL jump;
|
|
|
/**
|
|
|
* @brief 是否允许跳过
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL jump;
|
|
|
|
|
|
///答错退回时间 -1表示不回退
|
|
|
@property (nonatomic, assign, readonly)NSInteger backSecond;
|
|
|
/**
|
|
|
* @brief 答错退回时间,-1表示不回退
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger backSecond;
|
|
|
|
|
|
///选项列表
|
|
|
@property (nonatomic, strong, readonly)NSArray <DWVideoQuestionAnswerModel *> * answers;
|
|
|
/**
|
|
|
* @brief 选项列表
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoQuestionAnswerModel *> * answers;
|
|
|
|
|
|
///是否多选
|
|
|
@property (nonatomic, assign, readonly) BOOL multipleSelect;
|
|
|
/**
|
|
|
* @brief 是否多选
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL multipleSelect;
|
|
|
|
|
|
///是否显示问答
|
|
|
@property (nonatomic, assign) BOOL isShow;
|
|
|
/**
|
|
|
* @brief 答错能否继续播放
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL keepPlay;
|
|
|
|
|
|
/**
|
|
|
* @brief 是否显示问答
|
|
|
*/
|
|
|
@property(nonatomic, assign)BOOL isShow;
|
|
|
|
|
|
///视频问题选项数据模型DWVideoQuestionAnswerModel
|
|
|
///选项id
|
|
|
@property (nonatomic, strong, readonly)NSString * answerId;
|
|
|
/**
|
|
|
* @brief 选项id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * answerId;
|
|
|
|
|
|
///选项内容描述
|
|
|
@property (nonatomic, strong, readonly)NSString * content;
|
|
|
/**
|
|
|
* @brief 选项内容描述
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * content;
|
|
|
|
|
|
///是否是正确答案
|
|
|
@property (nonatomic, assign, readonly)BOOL isRight;
|
|
|
/**
|
|
|
* @brief 是否是正确答案
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isRight;
|
|
|
|
|
|
```
|
|
|
|
... | ... | @@ -670,41 +858,68 @@ DWVideoQuestionModel数据及含义如下: |
|
|
具体数据及含义如下:
|
|
|
|
|
|
```
|
|
|
///取值含义 -1 无字幕 ,0:subtitle, 1:subtitle2, 2:双语字幕
|
|
|
@property (nonatomic, assign, readonly) NSInteger defaultSubtitle;
|
|
|
///字幕1
|
|
|
@property (nonatomic, strong, readonly) DWVideoSubtitleModel * subtitle;
|
|
|
///字幕2
|
|
|
@property (nonatomic, strong, readonly) DWVideoSubtitleModel * subtitle2;
|
|
|
/**
|
|
|
* @brief 字幕类型,-1 无字幕 ,0 subtitle, 1 subtitle2, 2 双语
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger defaultSubtitle;
|
|
|
|
|
|
/**
|
|
|
* @brief 字幕1
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoSubtitleModel * subtitle;
|
|
|
|
|
|
/**
|
|
|
* @brief 字幕2
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoSubtitleModel * subtitle2;
|
|
|
|
|
|
//DWVideoSubtitleModel对象
|
|
|
|
|
|
///字幕文件地址
|
|
|
@property (nonatomic, strong, readonly)NSString * url;
|
|
|
/**
|
|
|
* @brief 字幕文件地址
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * url;
|
|
|
|
|
|
/**
|
|
|
* @brief 字幕字体
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * font;
|
|
|
|
|
|
///字幕字体
|
|
|
@property (nonatomic, strong, readonly)NSString * font;
|
|
|
/**
|
|
|
* @brief 字幕字体大小
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)CGFloat size;
|
|
|
|
|
|
///字幕字体大小
|
|
|
@property (nonatomic, assign, readonly)CGFloat size;
|
|
|
/**
|
|
|
* @brief 字幕字体色值 eg:0xFFFFFF
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * color;
|
|
|
|
|
|
///字幕字体色值 eg:0xFFFFFF
|
|
|
@property (nonatomic, strong, readonly)NSString * color;
|
|
|
/**
|
|
|
* @brief 阴影色值 eg:0x000000
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * surroundColor;
|
|
|
|
|
|
///阴影色值 eg:0x000000
|
|
|
@property (nonatomic, strong, readonly)NSString * surroundColor;
|
|
|
/**
|
|
|
* @brief 字幕距离底部的偏移量 百分比
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)CGFloat bottom;
|
|
|
|
|
|
///字幕距离底部的偏移量 百分比
|
|
|
@property (nonatomic, assign, readonly)CGFloat bottom;
|
|
|
/**
|
|
|
* @brief 编码格式 utf-8/gbk
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * code;
|
|
|
|
|
|
///编码格式 utf-8 / gbk
|
|
|
@property (nonatomic, strong, readonly)NSString * code;
|
|
|
/**
|
|
|
* @brief 字幕名称
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * subtitleName;
|
|
|
|
|
|
///字幕名称
|
|
|
@property (nonatomic, strong, readonly)NSString * subtitleName;
|
|
|
/**
|
|
|
* @brief 双语字幕中的位置,1:上, 2:下 单字幕时sort=0
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger sort;
|
|
|
|
|
|
///双语字幕中的位置 1:上, 2:下 单字幕时sort=0
|
|
|
@property (nonatomic, assign, readonly)NSInteger sort;
|
|
|
```
|
|
|
|
|
|
## 1.7 授权验证功能
|
... | ... | @@ -712,17 +927,25 @@ DWVideoQuestionModel数据及含义如下: |
|
|
|
|
|
DWVideoAuthorizeModel数据及含义如下:
|
|
|
```
|
|
|
///是否允许完整播放 NO:不允许完整播放 YES:允许完整播放
|
|
|
@property (nonatomic, assign, readonly)BOOL enable;
|
|
|
/**
|
|
|
* @brief 是否允许完整播放,NO:不允许完整播放 YES:允许完整播放
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL enable;
|
|
|
|
|
|
///视频试看时间,单位:秒
|
|
|
@property (nonatomic, assign, readonly)NSInteger freetime;
|
|
|
/**
|
|
|
* @brief 视频试看时间,单位:秒
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger freetime;
|
|
|
|
|
|
///提示内容
|
|
|
@property (nonatomic, strong, readonly)NSString * message;
|
|
|
/**
|
|
|
* @brief 提示内容
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * message;
|
|
|
|
|
|
///跑马灯数据
|
|
|
@property (nonatomic, strong, readonly)NSString * marqueeStr;
|
|
|
/**
|
|
|
* @brief 跑马灯数据
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * marqueeStr;
|
|
|
```
|
|
|
|
|
|
### 1.7.1 跑马灯功能
|
... | ... | @@ -730,67 +953,102 @@ DWVideoAuthorizeModel数据及含义如下: |
|
|
|
|
|
HDMarqueeView是跑马灯视图。
|
|
|
```
|
|
|
///开始跑马灯
|
|
|
-(void)startMarquee;
|
|
|
|
|
|
///结束跑马灯
|
|
|
-(void)stopMarquee;
|
|
|
|
|
|
///父视图,必填
|
|
|
/**
|
|
|
* @brief 父视图,必填
|
|
|
*/
|
|
|
@property(nonatomic,assign)UIView * fatherView;
|
|
|
|
|
|
///跑马灯样式,默认文字样式
|
|
|
/**
|
|
|
* @brief 跑马灯样式,默认文字样式
|
|
|
*/
|
|
|
@property(nonatomic,assign)HDMarqueeViewStyle style;
|
|
|
|
|
|
///跑马灯文字内容
|
|
|
/**
|
|
|
* @brief 跑马灯文字内容
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * text;
|
|
|
|
|
|
///跑马灯文字格式
|
|
|
/**
|
|
|
* @brief 跑马灯文字格式
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSDictionary * textAttributed;
|
|
|
|
|
|
///跑马灯文字对齐方式,默认kCAAlignmentNatural
|
|
|
/**
|
|
|
* @brief 跑马灯文字对齐方式,默认kCAAlignmentNatural
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * textAlignmentMode;
|
|
|
|
|
|
///跑马灯文字显示不全时,裁剪方式,默认kCATruncationNone
|
|
|
/**
|
|
|
* @brief 跑马灯文字显示不全时,裁剪方式,默认kCATruncationNone
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * textTruncationMode;
|
|
|
|
|
|
///跑马灯文字是否自动换行,默认NO
|
|
|
/**
|
|
|
* @brief 跑马灯文字是否自动换行,默认NO
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL wrapped;
|
|
|
|
|
|
///跑马灯图片
|
|
|
/**
|
|
|
* @brief 跑马灯图片
|
|
|
*/
|
|
|
@property(nonatomic,strong)NSURL * imageURL;
|
|
|
|
|
|
///跑马灯图片显示模式,默认kCAGravityResize
|
|
|
@property(nonatomic,copy)NSString * imageGravity;
|
|
|
|
|
|
///跑马灯效果,必填
|
|
|
/**
|
|
|
* @brief 跑马灯效果,必填
|
|
|
*/
|
|
|
@property(nonatomic,strong)NSArray <HDMarqueeAction *> * actions;
|
|
|
|
|
|
///循环次数,默认1,0表示无限循环
|
|
|
/**
|
|
|
* @brief 循环次数,默认1,0表示无限循环
|
|
|
*/
|
|
|
@property(nonatomic,assign)NSInteger repeatCount;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始跑马灯
|
|
|
* @discussion 开始跑马灯
|
|
|
*/
|
|
|
-(void)startMarquee;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 结束跑马灯
|
|
|
* @discussion 结束跑马灯
|
|
|
*/
|
|
|
-(void)stopMarquee;
|
|
|
```
|
|
|
|
|
|
HDMarqueeAction是跑马灯的具体动作,比如在一个时间段内,从(0,0)点移动到(0.5,0.5)点
|
|
|
```
|
|
|
//持续时间
|
|
|
/**
|
|
|
* @brief 持续时间
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGFloat duration;
|
|
|
|
|
|
//动作开始时坐标位置
|
|
|
/**
|
|
|
* @brief 动作开始时坐标位置
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)HDMarqueeActionPosition * startPostion;
|
|
|
|
|
|
//动作结束时坐标位置
|
|
|
/**
|
|
|
* @brief 动作结束时坐标位置
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)HDMarqueeActionPosition * endPostion;
|
|
|
|
|
|
@end
|
|
|
|
|
|
///用于记录每次的位置
|
|
|
@interface HDMarqueeActionPosition : NSObject
|
|
|
|
|
|
///坐标位置,取值范围0 - 1,例如(0.5,0.5)
|
|
|
/**
|
|
|
* @brief 坐标位置,取值范围0 - 1,例如(0.5,0.5)
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGPoint pos;
|
|
|
|
|
|
///透明度,取值范围 0 - 1
|
|
|
/**
|
|
|
* @brief 透明度,取值范围0 - 1
|
|
|
*/
|
|
|
@property(nonatomic,assign)CGFloat alpha;
|
|
|
|
|
|
@end
|
|
|
```
|
|
|
|
|
|
## 1.8 广告功能
|
... | ... | @@ -812,41 +1070,63 @@ HDMarqueeAction是跑马灯的具体动作,比如在一个时间段内,从 |
|
|
### 1.8.2 DWVodAdInfoModel广告模型数据
|
|
|
DWVodAdInfoModel属性及含义如下:
|
|
|
```
|
|
|
///广告信息获取情况 0:获取成功 非0:获取失败
|
|
|
@property (nonatomic, assign, readonly) NSInteger result;
|
|
|
/**
|
|
|
* @brief 广告信息获取情况,0:获取成功 非0:获取失败
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger result;
|
|
|
|
|
|
///广告类型 1 片头广告 2 暂停广告
|
|
|
@property (nonatomic, assign, readonly) NSInteger type;
|
|
|
/**
|
|
|
* @brief 广告类型,1 片头广告 2 暂停广告
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger type;
|
|
|
|
|
|
///广告ID
|
|
|
@property (nonatomic, strong, readonly) NSString * adId;
|
|
|
/**
|
|
|
* @brief 广告ID
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * adId;
|
|
|
|
|
|
///广告展示时长
|
|
|
@property (nonatomic, assign, readonly) NSInteger time;
|
|
|
/**
|
|
|
* @brief 广告展示时长
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger time;
|
|
|
|
|
|
///是否响应点击
|
|
|
@property (nonatomic, assign, readonly) BOOL canClick;
|
|
|
/**
|
|
|
* @brief 是否响应点击
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL canClick;
|
|
|
|
|
|
///是否出现跳过广告按钮
|
|
|
@property (nonatomic, assign, readonly) BOOL canSkip;
|
|
|
/**
|
|
|
* @brief 是否出现跳过广告按钮
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL canSkip;
|
|
|
|
|
|
///跳过时间,单位秒,经过若干秒后显示跳过按钮,0代表立即显示跳过按钮
|
|
|
@property (nonatomic, assign, readonly) NSInteger skipTime;
|
|
|
/**
|
|
|
* @brief 跳过时间,单位秒,经过若干秒后显示跳过按钮,0代表立即显示跳过按钮
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger skipTime;
|
|
|
|
|
|
///广告信息
|
|
|
@property (nonatomic, strong, readonly) NSArray <DWVodAdMaterialModel *> * ads;
|
|
|
/**
|
|
|
* @brief 广告信息
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVodAdMaterialModel *> * ads;
|
|
|
```
|
|
|
|
|
|
广告信息模型DWVodAdMaterialModel属性及含义如下:
|
|
|
```
|
|
|
///素材id
|
|
|
@property (nonatomic, strong, readonly) NSString * materialId;
|
|
|
/**
|
|
|
* @brief 素材id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * materialId;
|
|
|
|
|
|
///素材链接
|
|
|
@property (nonatomic, strong, readonly) NSString * materialUrl;
|
|
|
/**
|
|
|
* @brief 素材链接
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * materialUrl;
|
|
|
|
|
|
///跳转链接
|
|
|
@property (nonatomic, strong, readonly) NSString * clickUrl;
|
|
|
/**
|
|
|
* @brief 跳转链接
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * clickUrl;
|
|
|
```
|
|
|
|
|
|
## 1.9 VR视频
|
... | ... | @@ -854,8 +1134,10 @@ DWVodAdInfoModel属性及含义如下: |
|
|
### 1.9.1 VR视频的判断
|
|
|
DWVodVideoModel对象中的vrmode,代表此视频是否是VR视频。
|
|
|
```
|
|
|
///是否支持VR 1表示播放VR视频,0表示普通
|
|
|
@property (nonatomic, assign, readonly) NSInteger vrmode;
|
|
|
/**
|
|
|
* @brief 是否支持VR,1表示播放VR视频,0表示普通
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger vrmode;
|
|
|
```
|
|
|
|
|
|
### 1.9.2 VR视频的播放
|
... | ... | @@ -893,48 +1175,65 @@ SDK提供DWGIFManager对象,来完成GIF录制。 |
|
|
DWGIFManager的方法属性及含义如下:
|
|
|
```
|
|
|
/**
|
|
|
* 制作完成GIF回调
|
|
|
*/
|
|
|
@property(nonatomic,copy) CompleteBlock completeBlock;
|
|
|
* Gif制作完成回调
|
|
|
* @param GifURL GIF的本地URL(本地路径存储到tmp文件夹下,如果需要本地保存,请copy到自己需要的路径下)
|
|
|
* @param error 错误原因
|
|
|
*/
|
|
|
typedef void(^CompleteBlock)(NSError *error,NSURL *GifURL);
|
|
|
|
|
|
@interface DWGIFManager : NSObject
|
|
|
|
|
|
/**
|
|
|
* 生成GIF质量
|
|
|
* @brief 制作完成GIF回调
|
|
|
*/
|
|
|
@property(nonatomic,assign) GIFQuality quality;
|
|
|
@property(nonatomic,copy)CompleteBlock completeBlock;
|
|
|
|
|
|
/**
|
|
|
* GIF播放的次数 0无限循环
|
|
|
*/
|
|
|
@property(nonatomic,assign) NSInteger loopCount;
|
|
|
* @brief 生成GIF质量
|
|
|
*/
|
|
|
@property(nonatomic,assign)GIFQuality quality;
|
|
|
|
|
|
/**
|
|
|
* 是否正在录制gif
|
|
|
*/
|
|
|
@property(nonatomic,readonly) BOOL isRecording;
|
|
|
* @brief GIF播放的次数,0无限循环
|
|
|
*/
|
|
|
@property(nonatomic,assign)NSInteger loopCount;
|
|
|
|
|
|
/**
|
|
|
* 关联播放器,startRecordingGif录制开始前调用 !!!在每次startRecordingGif前,都要调用此方法
|
|
|
|
|
|
* @brief 是否正在录制gif
|
|
|
*/
|
|
|
@property(nonatomic,readonly)BOOL isRecording;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 关联播放器
|
|
|
* @discussion 在startRecordingGif录制开始前调用,每次startRecordingGif前,都要调用此方法
|
|
|
* @param playUrl 播放路径
|
|
|
* @param currentPlayer 当前播放player
|
|
|
* @param m3u8Method 为YES,会强制使用m3u8视频格式截取GIF方式,一般设置为NO即可
|
|
|
*/
|
|
|
-(void)associationWithUrl:(NSURL *)playUrl CurrentPlayer:(AVPlayer *)currentPlayer AndUseM3U8Method:(BOOL)m3u8Method;
|
|
|
|
|
|
/**
|
|
|
* 开始录制gif
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始录制gif
|
|
|
* @discussion 开始录制gif
|
|
|
*/
|
|
|
-(void)startRecordingGif;
|
|
|
|
|
|
/**
|
|
|
* 结束录制gif 如果视频播放完成,内部会自动调用此方法,完成GIF回调
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 结束录制gif
|
|
|
* @discussion 如果视频播放完成,内部会自动调用此方法,完成GIF回调
|
|
|
*/
|
|
|
-(void)endRecordingGif;
|
|
|
|
|
|
/**
|
|
|
* 取消录制gif
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 取消录制gif
|
|
|
* @discussion 取消录制gif
|
|
|
*/
|
|
|
-(void)cancelRecordGif;
|
|
|
|
|
|
```
|
|
|
|
|
|
## 1.11 访客信息收集
|
... | ... | @@ -942,38 +1241,58 @@ DWGIFManager的方法属性及含义如下: |
|
|
|
|
|
DWVideoVisitorModel数据及含义如下:
|
|
|
```
|
|
|
///收集器ID
|
|
|
@property (nonatomic, strong, readonly)NSString * visitorId;
|
|
|
/**
|
|
|
* @brief 收集器ID
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * visitorId;
|
|
|
|
|
|
///收集器标题
|
|
|
@property (nonatomic, strong, readonly)NSString * title;
|
|
|
/**
|
|
|
* @brief 收集器标题
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * title;
|
|
|
|
|
|
///展现的时间,单位:秒
|
|
|
@property (nonatomic, assign, readonly)NSInteger appearTime;
|
|
|
/**
|
|
|
* @brief 展现的时间,单位:秒
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger appearTime;
|
|
|
|
|
|
///展现的图片地址
|
|
|
@property (nonatomic, strong, readonly)NSString * imageURL;
|
|
|
/**
|
|
|
* @brief 展现的图片地址
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * imageURL;
|
|
|
|
|
|
///图片的跳转地址
|
|
|
@property (nonatomic, strong, readonly)NSString * jumpURL;
|
|
|
/**
|
|
|
* @brief 图片的跳转地址
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * jumpURL;
|
|
|
|
|
|
///能否跳过
|
|
|
@property (nonatomic, assign, readonly)BOOL isJump;
|
|
|
/**
|
|
|
* @brief 能否跳过
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isJump;
|
|
|
|
|
|
///要收集的信息
|
|
|
@property (nonatomic, strong, readonly)NSArray <DWVideoVisitorMessageModel *> * visitorMessages;
|
|
|
/**
|
|
|
* @brief 要收集的信息
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoVisitorMessageModel *> * visitorMessages;
|
|
|
|
|
|
///是否显示问答
|
|
|
@property (nonatomic, assign) BOOL isShow;
|
|
|
/**
|
|
|
* @brief 是否显示问答
|
|
|
*/
|
|
|
@property(nonatomic, assign)BOOL isShow;
|
|
|
```
|
|
|
|
|
|
DWVideoVisitorMessageModel数据及含义如下:
|
|
|
```
|
|
|
///收集信息含义
|
|
|
@property (nonatomic, strong, readonly)NSString * visitorMes;
|
|
|
/**
|
|
|
* @brief 收集信息含义
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * visitorMes;
|
|
|
|
|
|
///收集信息提示
|
|
|
@property (nonatomic, strong, readonly)NSString * visitorTip;
|
|
|
/**
|
|
|
* @brief 收集信息提示
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * visitorTip;
|
|
|
```
|
|
|
|
|
|
## 1.12 课堂练习
|
... | ... | @@ -981,68 +1300,106 @@ DWVideoVisitorMessageModel数据及含义如下: |
|
|
|
|
|
DWVideoExercisesModel数据及含义如下:
|
|
|
```
|
|
|
///课堂练习id
|
|
|
@property (nonatomic, strong, readonly)NSString * exercisesId;
|
|
|
/**
|
|
|
* @brief 课堂练习id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * exercisesId;
|
|
|
|
|
|
///标题
|
|
|
@property (nonatomic, strong, readonly)NSString * title;
|
|
|
/**
|
|
|
* @brief 标题
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * title;
|
|
|
|
|
|
///展现的时间,单位:秒
|
|
|
@property (nonatomic, assign, readonly)NSInteger showTime;
|
|
|
/**
|
|
|
* @brief 展现的时间,单位:秒
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger showTime;
|
|
|
|
|
|
///课堂练习包含的问题列表
|
|
|
@property (nonatomic, strong, readonly)NSArray <DWVideoExercisesQuestionModel *> * questions;
|
|
|
/**
|
|
|
* @brief 课堂练习包含的问题列表
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoExercisesQuestionModel *> * questions;
|
|
|
|
|
|
///是否显示课堂练习
|
|
|
@property (nonatomic, assign) BOOL isShow;
|
|
|
/**
|
|
|
* @brief 是否显示课堂练习
|
|
|
*/
|
|
|
@property(nonatomic, assign)BOOL isShow;
|
|
|
```
|
|
|
|
|
|
DWVideoExercisesQuestionModel数据及含义如下:
|
|
|
```
|
|
|
///问题id
|
|
|
@property (nonatomic, strong, readonly)NSString * questionId;
|
|
|
/**
|
|
|
* @brief 问题id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * questionId;
|
|
|
|
|
|
///问题解释内容
|
|
|
@property (nonatomic, strong, readonly)NSString * explainInfo;
|
|
|
/**
|
|
|
* @brief 问题解释内容
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * explainInfo;
|
|
|
|
|
|
///问题类型 0:单选 1:多选 2:填空
|
|
|
@property (nonatomic, assign, readonly)NSInteger type;
|
|
|
/**
|
|
|
* @brief 问题类型,0:单选 1:多选 2:填空
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)NSInteger type;
|
|
|
|
|
|
///问题的标题 (填空题的前半段)
|
|
|
@property (nonatomic, strong, readonly)NSString * content;
|
|
|
/**
|
|
|
* @brief 问题的标题(填空题的前半段)
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * content;
|
|
|
|
|
|
///问题的标题 (填空题后半段,选择题是为nil)
|
|
|
@property (nonatomic, strong, readonly)NSString * content2;
|
|
|
/**
|
|
|
* @brief 问题的标题(填空题后半段,选择题是为nil)
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * content2;
|
|
|
|
|
|
///问题的答案
|
|
|
@property (nonatomic, strong, readonly)NSArray <DWVideoExercisesQuestionAnswerModel *> * answers;
|
|
|
/**
|
|
|
* @brief 问题的答案
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSArray <DWVideoExercisesQuestionAnswerModel *> * answers;
|
|
|
|
|
|
///此问题是否已经作答 YES:已答 NO:未答 注意:选择题,选项选中即为已答。填空题,内容填写即为已答。
|
|
|
@property (nonatomic, assign, readonly)BOOL isReply;
|
|
|
/**
|
|
|
* @brief 此问题是否已经作答,YES:已答 NO:未答。注意:选择题,选项选中即为已答。填空题,内容填写即为已答
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isReply;
|
|
|
|
|
|
///是否答对
|
|
|
@property (nonatomic, assign, readonly)BOOL isCorrect;
|
|
|
/**
|
|
|
* @brief 是否答对
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isCorrect;
|
|
|
|
|
|
///问题正确率
|
|
|
@property (nonatomic, assign) NSInteger accuracy;
|
|
|
/**
|
|
|
* @brief 问题正确率
|
|
|
*/
|
|
|
@property(nonatomic, assign)NSInteger accuracy;
|
|
|
```
|
|
|
|
|
|
DWVideoExercisesQuestionAnswerModel数据及含义如下:
|
|
|
```
|
|
|
///课堂练习问题答案id
|
|
|
@property (nonatomic, strong, readonly)NSString * answerId;
|
|
|
/**
|
|
|
* @brief 课堂练习问题答案id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * answerId;
|
|
|
|
|
|
///是否是正确选项
|
|
|
@property (nonatomic, assign, readonly)BOOL isRight;
|
|
|
/**
|
|
|
* @brief 是否是正确选项
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL isRight;
|
|
|
|
|
|
///选择题:选项的内容 填空题:正确答案
|
|
|
@property (nonatomic, strong, readonly)NSString * content;
|
|
|
/**
|
|
|
* @brief 选择题:选项的内容,填空题:正确答案
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * content;
|
|
|
|
|
|
///选择题是否选中
|
|
|
@property (nonatomic, assign) BOOL isSelect;
|
|
|
/**
|
|
|
* @brief 选择题是否选中
|
|
|
*/
|
|
|
@property(nonatomic, assign)BOOL isSelect;
|
|
|
|
|
|
///填空题填写内容
|
|
|
@property (nonatomic, strong) NSString * answerContent;
|
|
|
/**
|
|
|
* @brief 填空题填写内容
|
|
|
*/
|
|
|
@property(nonatomic, strong)NSString * answerContent;
|
|
|
```
|
|
|
|
|
|
## 1.13 视频投屏
|
... | ... | @@ -1052,40 +1409,45 @@ DWUPnPSearch是设备搜索类,负责搜索可投放视频的设备。 |
|
|
|
|
|
具体的属性及方法如下:
|
|
|
```
|
|
|
/**
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property (nonatomic, weak) id<DWUPnPSearchDelegate>delegate;
|
|
|
|
|
|
/**
|
|
|
开始搜索
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始搜索设备
|
|
|
* @discussion 开始搜索设备
|
|
|
*/
|
|
|
- (void)start;
|
|
|
-(void)start;
|
|
|
|
|
|
/**
|
|
|
销毁对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 重新搜索设备
|
|
|
* @discussion 重新搜索设备
|
|
|
*/
|
|
|
- (void)destroy;
|
|
|
-(void)refresh;
|
|
|
|
|
|
/**
|
|
|
重新搜索
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 销毁对象
|
|
|
* @discussion 销毁对象
|
|
|
*/
|
|
|
- (void)refresh;
|
|
|
-(void)destroy;
|
|
|
```
|
|
|
|
|
|
DWUPnPSearchDelegate方法如下:
|
|
|
```
|
|
|
/**
|
|
|
搜索结果
|
|
|
|
|
|
/** 搜索结果
|
|
|
@param devices 设备数组
|
|
|
*/
|
|
|
- (void)upnpSearchChangeWithResults:(NSArray <DWUPnPDevice *>*)devices;
|
|
|
-(void)upnpSearchChangeWithResults:(NSArray <DWUPnPDevice *>*)devices;
|
|
|
|
|
|
@optional
|
|
|
/**
|
|
|
搜索失败
|
|
|
|
|
|
@param error error
|
|
|
/** 搜索失败
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
- (void)upnpSearchErrorWithError:(NSError *)error;
|
|
|
-(void)upnpSearchErrorWithError:(NSError *)error;
|
|
|
```
|
|
|
|
|
|
### 1.13.2 投屏以及控制设备的事件
|
... | ... | @@ -1093,161 +1455,222 @@ DWUPnPRenderer是设备控制类,可以控制设备的播放链接,开始暂 |
|
|
|
|
|
DWUPnPRenderer的具体属性与方法如下:
|
|
|
```
|
|
|
//设备model
|
|
|
@property (nonatomic, strong) DWUPnPDevice *model;
|
|
|
|
|
|
@property (nonatomic, strong) id<DWUPnPResponseDelegate>delegate;
|
|
|
|
|
|
/**
|
|
|
初始化
|
|
|
@param model 搜索得到的UPnPModel
|
|
|
@return self
|
|
|
* @brief 设备model
|
|
|
*/
|
|
|
- (instancetype)initWithModel:(DWUPnPDevice *)model;
|
|
|
@property(nonatomic,strong)DWUPnPDevice * model;
|
|
|
|
|
|
/**
|
|
|
设置投屏地址
|
|
|
@param urlStr 视频url
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
- (void)setAVTransportURL:(NSString *)urlStr;
|
|
|
@property(nonatomic,strong)id <DWUPnPResponseDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
设置下一个播放地址
|
|
|
@param urlStr 下一个视频url
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化
|
|
|
* @discussion 初始化
|
|
|
* @param model 搜索得到的UPnPModel
|
|
|
* @result DWUPnPRenderer对象
|
|
|
*/
|
|
|
- (void)setNextAVTransportURI:(NSString *)urlStr;
|
|
|
-(instancetype)initWithModel:(DWUPnPDevice *)model;
|
|
|
|
|
|
/**
|
|
|
播放
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取播放进度,可通过协议回调使用
|
|
|
* @discussion 获取播放进度,可通过协议回调使用
|
|
|
*/
|
|
|
- (void)play;
|
|
|
-(void)getPositionInfo;
|
|
|
|
|
|
/**
|
|
|
暂停
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取播放状态,可通过协议回调使用
|
|
|
* @discussion 获取播放状态,可通过协议回调使用
|
|
|
*/
|
|
|
- (void)pause;
|
|
|
-(void)getTransportInfo;
|
|
|
|
|
|
/**
|
|
|
结束
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取音频,可通过协议回调使用
|
|
|
* @discussion 获取音频,可通过协议回调使用
|
|
|
*/
|
|
|
- (void)stop;
|
|
|
-(void)getVolume;
|
|
|
|
|
|
/**
|
|
|
下一个
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置投屏地址
|
|
|
* @discussion 设置投屏地址
|
|
|
* @param urlStr 视频url
|
|
|
*/
|
|
|
- (void)next;
|
|
|
-(void)setAVTransportURL:(NSString *)urlStr;
|
|
|
|
|
|
/**
|
|
|
前一个
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置下一个播放地址
|
|
|
* @discussion 设置下一个播放地址
|
|
|
* @param urlStr 下一个视频url
|
|
|
*/
|
|
|
- (void)previous;
|
|
|
-(void)setNextAVTransportURI:(NSString *)urlStr;
|
|
|
|
|
|
/**
|
|
|
跳转进度
|
|
|
@param relTime 进度时间(单位秒)
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 播放
|
|
|
* @discussion 播放
|
|
|
*/
|
|
|
- (void)seek:(float)relTime;
|
|
|
-(void)play;
|
|
|
|
|
|
/**
|
|
|
跳转至特定进度或视频
|
|
|
@param target 目标值,可以是 00:02:21 格式的进度或者整数的 TRACK_NR。
|
|
|
@param unit REL_TIME(跳转到某个进度)或 TRACK_NR(跳转到某个视频)。
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 暂停
|
|
|
* @discussion 暂停
|
|
|
*/
|
|
|
- (void)seekToTarget:(NSString *)target Unit:(NSString *)unit;
|
|
|
-(void)pause;
|
|
|
|
|
|
/**
|
|
|
获取播放进度,可通过协议回调使用
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 结束
|
|
|
* @discussion 结束
|
|
|
*/
|
|
|
- (void)getPositionInfo;
|
|
|
-(void)stop;
|
|
|
|
|
|
/**
|
|
|
获取播放状态,可通过协议回调使用
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 下一个
|
|
|
* @discussion 下一个
|
|
|
*/
|
|
|
- (void)getTransportInfo;
|
|
|
-(void)next;
|
|
|
|
|
|
/**
|
|
|
获取音频,可通过协议回调使用
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 前一个
|
|
|
* @discussion 前一个
|
|
|
*/
|
|
|
- (void)getVolume;
|
|
|
-(void)previous;
|
|
|
|
|
|
/**
|
|
|
设置音频值
|
|
|
@param value 值—>整数
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 跳转进度
|
|
|
* @discussion 跳转进度
|
|
|
* @param relTime 进度时间(单位秒)
|
|
|
*/
|
|
|
- (void)setVolumeWith:(NSString *)value;
|
|
|
-(void)seek:(float)relTime;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 跳转至特定进度或视频
|
|
|
* @discussion 跳转至特定进度或视频
|
|
|
* @param target 目标值,可以是 00:02:21 格式的进度或者整数的 TRACK_NR
|
|
|
* @param unit REL_TIME(跳转到某个进度)或 TRACK_NR(跳转到某个视频)
|
|
|
*/
|
|
|
-(void)seekToTarget:(NSString *)target Unit:(NSString *)unit;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置音频值
|
|
|
* @discussion 设置音频值
|
|
|
* @param value 值,整数
|
|
|
*/
|
|
|
-(void)setVolumeWith:(NSString *)value;
|
|
|
```
|
|
|
|
|
|
DWUPnPResponseDelegate对应DWUPnPRenderer的事件回调,设置成功后会被调用。以下是具体的方法含义:
|
|
|
```
|
|
|
@required
|
|
|
|
|
|
/// 设置url响应
|
|
|
- (void)upnpSetAVTransportURIResponse;
|
|
|
/** 设置url响应
|
|
|
*/
|
|
|
-(void)upnpSetAVTransportURIResponse;
|
|
|
|
|
|
/// 获取播放状态
|
|
|
- (void)upnpGetTransportInfoResponse:(DWUPnPTransportInfo *)info;
|
|
|
/** 获取播放状态
|
|
|
@param info 返回数据
|
|
|
*/
|
|
|
-(void)upnpGetTransportInfoResponse:(DWUPnPTransportInfo *)info;
|
|
|
|
|
|
@optional
|
|
|
|
|
|
/**
|
|
|
未定义的响应/错误
|
|
|
|
|
|
/** 未定义的响应/错误
|
|
|
@param resXML 响应XML
|
|
|
@param postXML 请求的动作
|
|
|
*/
|
|
|
- (void)upnpUndefinedResponse:(NSString *)resXML postXML:(NSString *)postXML;
|
|
|
-(void)upnpUndefinedResponse:(NSString *)resXML postXML:(NSString *)postXML;
|
|
|
|
|
|
/// 播放响应
|
|
|
- (void)upnpPlayResponse;
|
|
|
/** 播放响应
|
|
|
*/
|
|
|
-(void)upnpPlayResponse;
|
|
|
|
|
|
/// 暂停响应
|
|
|
- (void)upnpPauseResponse;
|
|
|
/** 暂停响应
|
|
|
*/
|
|
|
-(void)upnpPauseResponse;
|
|
|
|
|
|
/// 停止投屏
|
|
|
- (void)upnpStopResponse;
|
|
|
/** 停止投屏
|
|
|
*/
|
|
|
-(void)upnpStopResponse;
|
|
|
|
|
|
/// 跳转响应
|
|
|
- (void)upnpSeekResponse;
|
|
|
/** 跳转响应
|
|
|
*/
|
|
|
-(void)upnpSeekResponse;
|
|
|
|
|
|
/// 以前的响应
|
|
|
- (void)upnpPreviousResponse;
|
|
|
/** previous响应
|
|
|
*/
|
|
|
-(void)upnpPreviousResponse;
|
|
|
|
|
|
/// 下一个响应
|
|
|
- (void)upnpNextResponse;
|
|
|
/** next响应
|
|
|
*/
|
|
|
-(void)upnpNextResponse;
|
|
|
|
|
|
/// 设置音量响应
|
|
|
- (void)upnpSetVolumeResponse;
|
|
|
/** 设置音量响应
|
|
|
*/
|
|
|
-(void)upnpSetVolumeResponse;
|
|
|
|
|
|
/// 设置下一个url响应
|
|
|
- (void)upnpSetNextAVTransportURIResponse;
|
|
|
/** 设置下一个url响应
|
|
|
*/
|
|
|
-(void)upnpSetNextAVTransportURIResponse;
|
|
|
|
|
|
/// 获取音频信息
|
|
|
- (void)upnpGetVolumeResponse:(NSString *)volume;
|
|
|
/** 获取音量信息
|
|
|
@param info 音量信息
|
|
|
*/
|
|
|
-(void)upnpGetVolumeResponse:(NSString *)volume;
|
|
|
|
|
|
/// 获取播放进度
|
|
|
- (void)upnpGetPositionInfoResponse:(DWUPnPAVPositionInfo *)info;
|
|
|
/** 获取播放进度
|
|
|
@param info 返回数据
|
|
|
*/
|
|
|
-(void)upnpGetPositionInfoResponse:(DWUPnPAVPositionInfo *)info;
|
|
|
```
|
|
|
|
|
|
DWUPnPDevice设备类,包含了一些设备的属性。以下是属性及含义:
|
|
|
```
|
|
|
///设备ID
|
|
|
/**
|
|
|
* @brief 设备ID
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * uuid;
|
|
|
|
|
|
///设备loactionURL
|
|
|
/**
|
|
|
* @brief 设备loactionURL
|
|
|
*/
|
|
|
@property(nonatomic,strong)NSURL * loaction;
|
|
|
|
|
|
///设备地址
|
|
|
/**
|
|
|
* @brief 设备地址
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * URLHeader;
|
|
|
|
|
|
///友好的设备名称
|
|
|
@property(nonatomic,copy) NSString * friendlyName;
|
|
|
/**
|
|
|
* @brief 友好的设备名称
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * friendlyName;
|
|
|
|
|
|
//设备名称
|
|
|
@property(nonatomic,copy) NSString * modelName;
|
|
|
/**
|
|
|
* @brief 设备名称
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * modelName;
|
|
|
|
|
|
@property(nonatomic,strong) DWServiceModel * AVTransport;
|
|
|
/**
|
|
|
* @brief DWServiceModel对象
|
|
|
*/
|
|
|
@property(nonatomic,strong)DWServiceModel * AVTransport;
|
|
|
|
|
|
@property(nonatomic,strong) DWServiceModel * RenderingControl;
|
|
|
/**
|
|
|
* @brief DWServiceModel对象
|
|
|
*/
|
|
|
@property(nonatomic,strong)DWServiceModel * RenderingControl;
|
|
|
```
|
|
|
|
|
|
### 1.13.3 接收投屏设备的回调
|
... | ... | @@ -1255,44 +1678,61 @@ DWUPnPSubscription是设备订阅类,主要负责订阅设备以及接收设 |
|
|
|
|
|
具体的方法及含义如下:
|
|
|
```
|
|
|
//设备model
|
|
|
/**
|
|
|
* @brief 设备model
|
|
|
*/
|
|
|
@property(nonatomic,strong)DWUPnPDevice *model;
|
|
|
|
|
|
/**
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak)id <DWUPnPSubscriptionDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
初始化
|
|
|
@param model 搜索得到的UPnPModel
|
|
|
@return self
|
|
|
* @method
|
|
|
* @abstract 初始化
|
|
|
* @discussion 初始化
|
|
|
* @param model 搜索得到的UPnPModel
|
|
|
* @return DWUPnPSubscription对象
|
|
|
*/
|
|
|
- (instancetype)initWithModel:(DWUPnPDevice *)model;
|
|
|
-(instancetype)initWithModel:(DWUPnPDevice *)model;
|
|
|
|
|
|
/**
|
|
|
开始订阅
|
|
|
* @method
|
|
|
* @abstract 开始订阅
|
|
|
* @discussion 开始订阅
|
|
|
*/
|
|
|
-(void)startSubscribe;
|
|
|
|
|
|
/**
|
|
|
结束订阅
|
|
|
* @method
|
|
|
* @abstract 结束订阅
|
|
|
* @discussion 结束订阅
|
|
|
*/
|
|
|
-(void)cancelSubscribe;
|
|
|
```
|
|
|
|
|
|
DWUPnPSubscriptionDelegate是接收到回调事件,以下是它方法的具体含义:
|
|
|
```
|
|
|
///视频传输中
|
|
|
/** 视频传输中
|
|
|
*/
|
|
|
-(void)upnpSubscriptionTransition;
|
|
|
|
|
|
///设备播放投屏
|
|
|
/** 设备播放投屏
|
|
|
*/
|
|
|
-(void)upnpSubscriptionPlay;
|
|
|
|
|
|
///设备暂停投屏
|
|
|
/** 设备暂停投屏
|
|
|
*/
|
|
|
-(void)upnpSubscriptionPause;
|
|
|
|
|
|
///设备退出投屏
|
|
|
/** 设备退出投屏
|
|
|
*/
|
|
|
-(void)upnpSubscriptionStop;
|
|
|
|
|
|
///error回调
|
|
|
/** error回调
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)upnpSubscriptionWithError:(NSError *)error;
|
|
|
```
|
|
|
|
... | ... | @@ -1301,47 +1741,83 @@ DWUPnPSubscriptionDelegate是接收到回调事件,以下是它方法的具体 |
|
|
### 1.14.1 视频弹幕类的说明
|
|
|
DWBarrageManager是SDK中的弹幕管理类,负责弹幕的获取及发送。
|
|
|
```
|
|
|
///视频id
|
|
|
/**
|
|
|
* @brief 视频id
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * videoId;
|
|
|
|
|
|
///代理
|
|
|
/**
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak)id <DWBarrageManagerDelegate> delegate;
|
|
|
|
|
|
/// 设置当前播放时间
|
|
|
/// @param time 当前播放时间
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 设置当前播放时间
|
|
|
* @discussion 设置当前播放时间
|
|
|
* @param time 当前播放时间
|
|
|
*/
|
|
|
-(void)associationWithTimeDidChange:(float)time;
|
|
|
|
|
|
/// 发送弹幕
|
|
|
/// @param barrageModel 弹幕模型
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 发送弹幕
|
|
|
* @discussion 发送弹幕
|
|
|
* @param barrageModel 弹幕模型
|
|
|
*/
|
|
|
-(void)sendBarrageWithBarrageModel:(DWBarrageModel *)barrageModel;
|
|
|
|
|
|
/// 销毁进行中的请求,只对获取弹幕请求有效,发送弹幕的请求不会被销毁。
|
|
|
- (void)cancelRequest;
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 销毁进行中的请求
|
|
|
* @discussion 只对获取弹幕请求有效,发送弹幕的请求不会被销毁。
|
|
|
*/
|
|
|
-(void)cancelRequest;
|
|
|
```
|
|
|
DWBarrageManagerDelegate方法如下:
|
|
|
```
|
|
|
//收到弹幕响应回调
|
|
|
/** 收到弹幕响应回调
|
|
|
@param barrageManager 自身对象
|
|
|
@param barrageList 字幕列表
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)getBarrageManager:(DWBarrageManager *)barrageManager BarrageList:(NSArray <DWBarrageModel *> *)barrageList WithError:(NSError *)error;
|
|
|
//发送弹幕回调
|
|
|
|
|
|
/** 发送弹幕回调
|
|
|
@param barrageManager 自身对象
|
|
|
@param sendBarrageModel 字幕模型
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)sendBarrageManager:(DWBarrageManager *)barrageManager BarrageModel:(DWBarrageModel *)sendBarrageModel WithError:(NSError *)error;
|
|
|
```
|
|
|
|
|
|
每一条弹幕对应一个DWBarrageModel对象,具体的含义如下:
|
|
|
```
|
|
|
/// 初始化方法
|
|
|
/// @param content 字幕内容
|
|
|
/// @param fc 字幕颜色,eg:0xffffff
|
|
|
/// @param pt 弹幕时间,单位毫秒
|
|
|
-(instancetype)initWithContent:(NSString *)content Fc:(NSString *)fc Pt:(NSInteger)pt;
|
|
|
|
|
|
///字幕内容
|
|
|
/**
|
|
|
* @brief 字幕内容
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * content;
|
|
|
|
|
|
///字幕颜色
|
|
|
/**
|
|
|
* @brief 字幕颜色
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * fc;
|
|
|
|
|
|
///播放时间点,单位:毫秒
|
|
|
/**
|
|
|
* @brief 播放时间点,单位:毫秒
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSInteger pt;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化方法
|
|
|
* @discussion 初始化方法
|
|
|
* @param content 字幕内容
|
|
|
* @param fc 字幕颜色,eg:0xffffff
|
|
|
* @param pt 弹幕时间,单位毫秒
|
|
|
* @result DWBarrageModel对象
|
|
|
*/
|
|
|
-(instancetype)initWithContent:(NSString *)content Fc:(NSString *)fc Pt:(NSInteger)pt;
|
|
|
```
|
|
|
|
|
|
### 1.14.2 视频弹幕的获取
|
... | ... | @@ -1400,7 +1876,11 @@ DWBarrageManagerDelegate方法如下: |
|
|
|
|
|
4.收到DWBarrageManagerDelegate回调。
|
|
|
```
|
|
|
//收到弹幕响应回调
|
|
|
/** 收到弹幕响应回调
|
|
|
@param barrageManager 自身对象
|
|
|
@param barrageList 字幕列表
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)getBarrageManager:(DWBarrageManager *)barrageManager BarrageList:(NSArray <DWBarrageModel *> *)barrageList WithError:(NSError *)error
|
|
|
{
|
|
|
if (error) {
|
... | ... | @@ -1433,7 +1913,11 @@ DWBarrageManagerDelegate方法如下: |
|
|
|
|
|
2.收到DWBarrageManagerDelegate回调。
|
|
|
```
|
|
|
//发送弹幕回调
|
|
|
/** 发送弹幕回调
|
|
|
@param barrageManager 自身对象
|
|
|
@param sendBarrageModel 字幕模型
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)sendBarrageManager:(DWBarrageManager *)barrageManager BarrageModel:(DWBarrageModel *)sendBarrageModel WithError:(NSError *)error
|
|
|
{
|
|
|
if (error) {
|
... | ... | @@ -1446,7 +1930,7 @@ DWBarrageManagerDelegate方法如下: |
|
|
|
|
|
//加载自己发送的弹幕
|
|
|
[self setBarrageWithModel:sendBarrageModel Send:YES];
|
|
|
}
|
|
|
}
|
|
|
```
|
|
|
|
|
|
# 2.下载功能
|
... | ... | @@ -1459,174 +1943,209 @@ DWDownloadSessionManager是下载管理类,所有有关下载的操作,都 |
|
|
以下是具体的属性及方法:
|
|
|
```
|
|
|
/**
|
|
|
下载任务队列
|
|
|
* @brief 下载任务队列
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly) NSArray <DWDownloadModel *> * downloadModelList;
|
|
|
@property(nonatomic,strong,readonly)NSArray <DWDownloadModel *> * downloadModelList;
|
|
|
|
|
|
/**
|
|
|
代理
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak) id<DWDownloadSessionDelegate> delegate;
|
|
|
@property(nonatomic,weak)id<DWDownloadSessionDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
注意:修改下载设置后,对已经存在的下载任务可能无效,请清空下载任务之后修改设置
|
|
|
*/
|
|
|
|
|
|
/**
|
|
|
是否允许使用移动流量 YES支持 NO不支持 默认支持
|
|
|
* @brief 是否允许使用移动流量 YES支持 NO不支持 默认支持
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL allowsCellular;
|
|
|
|
|
|
/**
|
|
|
全部并发 默认YES, 当YES时,忽略maxDownloadCount
|
|
|
* @brief 全部并发,默认YES, 当YES时,忽略maxDownloadCount
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL isBatchDownload;
|
|
|
|
|
|
/**
|
|
|
允许同时下载的最大并发数,默认为1,最大为4
|
|
|
* @brief 允许同时下载的最大并发数,默认为1,最大为4
|
|
|
*/
|
|
|
@property(nonatomic,assign)NSInteger maxDownloadCount;
|
|
|
|
|
|
/**
|
|
|
等待下载队列 先进先出 默认YES, 当NO时,先进后出
|
|
|
* @brief 等待下载队列 先进先出 默认YES,当NO时,先进后出
|
|
|
*/
|
|
|
@property(nonatomic,assign)BOOL resumeDownloadFIFO;
|
|
|
|
|
|
/**
|
|
|
初始化DWDownloadSessionManager
|
|
|
@return DWDownloadSessionManager对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化DWDownloadSessionManager
|
|
|
* @discussion 初始化DWDownloadSessionManager
|
|
|
* @result DWDownloadSessionManager对象
|
|
|
*/
|
|
|
+(DWDownloadSessionManager *)manager;
|
|
|
|
|
|
/**
|
|
|
* 初始化DWDownloadModel
|
|
|
@param videoMdoel 点播视频model 非空
|
|
|
@param quality 媒体品质 非空
|
|
|
@param othersInfo 自定义字段 可为空
|
|
|
@return 创建成功返回DWDownloadModel对象,如果失败,返回nil
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化DWDownloadModel
|
|
|
* @discussion 初始化DWDownloadModel
|
|
|
* @param videoMdoel 点播视频model,非空
|
|
|
* @param quality 媒体品质,非空
|
|
|
* @param othersInfo 自定义字段,可为空
|
|
|
* @result 创建成功返回DWDownloadModel对象,如果失败,返回nil
|
|
|
*/
|
|
|
+(DWDownloadModel *)createDownloadModel:(DWVodVideoModel *)videoMdoel Quality:(NSString *)quality AndOthersInfo:(NSDictionary * _Nullable )othersInfo;
|
|
|
+(DWDownloadModel *)createDownloadModel:(DWVodVideoModel *)videoMdoel Quality:(NSString *)quality AndOthersInfo:(NSDictionary *)othersInfo;
|
|
|
|
|
|
/**
|
|
|
开始下载任务
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始下载任务
|
|
|
* @discussion 开始下载任务
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)startWithDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
开始下载任务 ,所有回调均已回到主线程中
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
@param progress 下载进度回调
|
|
|
@param state 下载状态变动回调
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始下载任务
|
|
|
* @discussion 所有回调均已回到主线程中
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
* @param progress 下载进度回调
|
|
|
* @param state 下载状态变动回调
|
|
|
*/
|
|
|
-(void)startWithDownloadModel:(DWDownloadModel *)downloadModel progress:(DWDownloadProgressBlock)progress state:(DWDownloadStateBlock)state;
|
|
|
|
|
|
/**
|
|
|
暂停下载任务
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 暂停下载任务
|
|
|
* @discussion 暂停下载任务
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)suspendWithDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
恢复下载任务
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 恢复下载任务
|
|
|
* @discussion 恢复下载任务
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)resumeWithDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
删除下载任务以及本地缓存
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 删除下载任务以及本地缓存
|
|
|
* @discussion 删除下载任务以及本地缓存
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)deleteWithDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
暂停全部任务
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 暂停全部任务
|
|
|
* @discussion 暂停全部任务
|
|
|
*/
|
|
|
-(void)suspendAllDownloadModel;
|
|
|
|
|
|
/**
|
|
|
删除全部任务
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 删除全部任务
|
|
|
* @discussion 删除全部任务
|
|
|
*/
|
|
|
-(void)deleteAllDownloadModel;
|
|
|
|
|
|
/**
|
|
|
获取下载模型
|
|
|
@param URLString 下载地址
|
|
|
@return DWDownloadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 获取下载模型
|
|
|
* @discussion 获取下载模型
|
|
|
* @param URLString 下载地址
|
|
|
* @result DWDownloadModel对象
|
|
|
*/
|
|
|
- (DWDownloadModel *)downLoadingModelForURLString:(NSString *)URLString;
|
|
|
-(DWDownloadModel *)downLoadingModelForURLString:(NSString *)URLString;
|
|
|
|
|
|
/**
|
|
|
判断当前资源是已在下载队列中
|
|
|
@param videoId 视频id 非空
|
|
|
@param quality 媒体品质 非空
|
|
|
@return YES 已存在 NO 未存在
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 判断当前资源是已在下载队列中
|
|
|
* @discussion 判断当前资源是已在下载队列中
|
|
|
* @param videoId 视频id,非空
|
|
|
* @param quality 媒体品质,非空
|
|
|
* @result 查询结果
|
|
|
*/
|
|
|
-(BOOL)checkLocalResourceWithVideoId:(NSString *)videoId WithQuality:(NSString *)quality;
|
|
|
|
|
|
/**
|
|
|
判断downloadModel下载链接是否有效
|
|
|
@param downloadModel DWDownloadModel对象
|
|
|
@return YES有效 NO无效,需重新获取下载链接
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 判断downloadModel下载链接是否有效
|
|
|
* @discussion 下载链接具有时效性,若超时,请调用reStartDownloadUrlWithNewUrlString:AndDownloadModel:方法
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
* @result 查询结果
|
|
|
*/
|
|
|
-(BOOL)isValidateURLWithDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
根据新的下载地址,继续下载此任务
|
|
|
@param newUrlString 新的下载地址
|
|
|
@param downloadModel 需要修改的downloadModel
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 根据新的下载地址,继续下载此任务
|
|
|
* @discussion 下载链接超时时,调用此方法继续下载当前任务
|
|
|
* @param newUrlString 新的下载地址
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
*/
|
|
|
-(void)reStartDownloadUrlWithNewUrlString:(NSString *)newUrlString AndDownloadModel:(DWDownloadModel *)downloadModel;
|
|
|
|
|
|
/**
|
|
|
获取appdelegate,handleEventsForBackgroundURLSession事件回调
|
|
|
|
|
|
@param identifier identifier
|
|
|
@param completionHandler completionHandler
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 事件透传
|
|
|
* @discussion 获取appdelegate,handleEventsForBackgroundURLSession事件回调
|
|
|
* @param identifier identifier
|
|
|
* @param completionHandler completionHandler
|
|
|
*/
|
|
|
-(void)setBackgroundSession:(NSString *)identifier CompletionHandler:(void (^)())completionHandler;
|
|
|
|
|
|
//3.x.x升级4.x.x以上版本所使用的过渡方法
|
|
|
/**
|
|
|
若从3.x.x版本升级到4.x.x,会出现旧版本下载的音视频文件找不到的情况。
|
|
|
可以通过执行此方法,生成新版SDk的下载任务。
|
|
|
|
|
|
@param loaclPath 对于已完成的任务,必填。对于未完成的任务,请务必传nil
|
|
|
@param downloadUrl 网络下载地址。对于未完成的任务,必填
|
|
|
@param mediaType 文件类型 1 视频 2 音频。 若不填写,默认视频
|
|
|
@param quality 清晰度。 若不填写,默认 10
|
|
|
@param desp 清晰度描述。 若不填写,默认 标清
|
|
|
@param vrMode 是否是VR视频。 默认
|
|
|
@param othersInfo 自定义字段 根据自己需求适当添加,比如添加媒体图片,标题等。
|
|
|
@param userId 用户ID。 选填
|
|
|
@param videoId 视频ID。 选填
|
|
|
@param totalBytesWritten 已下载的数量。对于未完成的任务,必填
|
|
|
@param totalBytesExpectedToWrite 文件的总大小。对于未完成的任务,必填
|
|
|
@return 若过渡成功,返回DWDownloadModel对象,否则返回nil
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 3.x.x升级4.x.x以上版本所使用的过渡方法
|
|
|
* @discussion 若从3.x.x版本升级到4.x.x,会出现旧版本下载的音视频文件找不到的情况。
|
|
|
可以通过执行此方法,生成新版SDk的下载任务
|
|
|
* @param loaclPath 对于已完成的任务,必填。对于未完成的任务,请务必传nil
|
|
|
* @param downloadUrl 网络下载地址。对于未完成的任务,必填
|
|
|
* @param mediaType 文件类型,1 视频 2 音频。若不填写,默认视频
|
|
|
* @param quality 清晰度,若不填写,默认 10
|
|
|
* @param desp 清晰度描述,若不填写,默认 标清
|
|
|
* @param vrMode 是否是VR视频。默认 NO
|
|
|
* @param othersInfo 自定义字段,根据自己需求适当添加,比如添加媒体图片,标题等
|
|
|
* @param userId 用户ID,选填
|
|
|
* @param videoId 视频ID,选填
|
|
|
* @param totalBytesWritten 已下载的数量。对于未完成的任务,必填
|
|
|
* @param totalBytesExpectedToWrite 文件的总大小。对于未完成的任务,必填
|
|
|
* @result 若过渡成功,返回DWDownloadModel对象,否则返回nil
|
|
|
*/
|
|
|
-(DWDownloadModel *)migrateDownloadTask:(NSString *)loaclPath
|
|
|
DownloadUrl:(NSString *)downloadUrl
|
|
|
MediaType:(NSString *)mediaType
|
|
|
Quality:(NSString *)quality
|
|
|
Desp:(NSString *)desp
|
|
|
VRMode:(BOOL)vrMode
|
|
|
OthersInfo:(NSDictionary *)othersInfo
|
|
|
UserId:(NSString *)userId
|
|
|
VideoId:(NSString *)videoId
|
|
|
TotalBytesWritten:(int64_t)totalBytesWritten TotalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite;
|
|
|
DownloadUrl:(NSString *)downloadUrl
|
|
|
MediaType:(NSString *)mediaType
|
|
|
Quality:(NSString *)quality
|
|
|
Desp:(NSString *)desp
|
|
|
VRMode:(BOOL)vrMode
|
|
|
OthersInfo:(NSDictionary *)othersInfo
|
|
|
UserId:(NSString *)userId
|
|
|
VideoId:(NSString *)videoId
|
|
|
TotalBytesWritten:(int64_t)totalBytesWritten
|
|
|
TotalBytesExpectedToWrite:(int64_t)totalBytesExpectedToWrite;
|
|
|
```
|
|
|
|
|
|
## 2.3 下载功能的回调
|
|
|
DWDownloadSessionManagerDelegate,方法说明如下:
|
|
|
```
|
|
|
// 更新下载进度
|
|
|
- (void)downloadModel:(DWDownloadModel *)downloadModel didUpdateProgress:(DWDownloadProgress *)progress;
|
|
|
/** 更新下载进度回调
|
|
|
@param downloadModel 自身对象
|
|
|
@param progress 下载进度
|
|
|
*/
|
|
|
-(void)downloadModel:(DWDownloadModel *)downloadModel didUpdateProgress:(DWDownloadProgress *)progress;
|
|
|
|
|
|
// 更新下载状态
|
|
|
- (void)downloadModel:(DWDownloadModel *)downloadModel error:(NSError *)error;
|
|
|
/** 更新下载状态/出现error时回调
|
|
|
@param downloadModel 自身对象
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)downloadModel:(DWDownloadModel *)downloadModel error:(NSError *)error;
|
|
|
|
|
|
// 后台下载完成时回调
|
|
|
- (void)backgroundSessionCompletion;
|
|
|
/** 后台下载完成时回调
|
|
|
*/
|
|
|
-(void)downloadBackgroundSessionCompletion;
|
|
|
```
|
|
|
|
|
|
## 2.4 DWDownloadModel数据模型的使用
|
... | ... | @@ -1634,79 +2153,133 @@ DWDownloadModel对象对应具体的下载任务。 |
|
|
|
|
|
以下是具体DWDownloadModel中,包含的字段及含义:
|
|
|
```
|
|
|
/// 下载地址
|
|
|
@property (nonatomic, strong, readonly) NSString * downloadURL;
|
|
|
/**
|
|
|
* @brief 下载地址
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * downloadURL;
|
|
|
|
|
|
/**
|
|
|
* @brief 文件名
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * fileName;
|
|
|
|
|
|
/**
|
|
|
* @brief 存储路径
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * filePath;
|
|
|
|
|
|
/// 文件名 默认nil 则为下载URL中的文件名
|
|
|
@property (nonatomic, strong, readonly) NSString * fileName;
|
|
|
/**
|
|
|
* @brief 下载状态
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)DWDownloadState state;
|
|
|
|
|
|
/// 存储路径
|
|
|
@property (nonatomic, strong, readonly) NSString * filePath;
|
|
|
/**
|
|
|
* @brief 文件类型,1 视频 2 音频
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * mediaType;
|
|
|
|
|
|
/// 下载状态
|
|
|
@property (nonatomic, assign, readonly) DWDownloadState state;
|
|
|
/**
|
|
|
* @brief 文件后缀名
|
|
|
*/
|
|
|
@property(nonatomic ,strong, readonly)NSString * mimeType;
|
|
|
|
|
|
/// 文件类型 1 视频 2 音频
|
|
|
@property (nonatomic, strong, readonly) NSString * mediaType;
|
|
|
/**
|
|
|
* @brief 清晰度
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * quality;
|
|
|
|
|
|
/// 文件后缀名
|
|
|
@property (nonatomic ,strong, readonly) NSString * mimeType;
|
|
|
/**
|
|
|
* @brief 清晰度描述
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * desp;
|
|
|
|
|
|
/// 清晰度
|
|
|
@property (nonatomic, strong, readonly) NSString * quality;
|
|
|
/**
|
|
|
* @brief VR视频
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)BOOL vrMode;
|
|
|
|
|
|
/// 清晰度描述
|
|
|
@property (nonatomic, strong, readonly) NSString * desp;
|
|
|
/**
|
|
|
* @brief resumeData
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSData * resumeData;
|
|
|
|
|
|
/// VR视频
|
|
|
@property (nonatomic, assign, readonly) BOOL vrMode;
|
|
|
/**
|
|
|
* @brief userId
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * userId;
|
|
|
|
|
|
/// URL失效后的断点续传需要设置这个数据
|
|
|
@property (nonatomic, strong, readonly) NSData * resumeData;
|
|
|
/**
|
|
|
* @brief 视频id
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * videoId;
|
|
|
|
|
|
///userId
|
|
|
@property (nonatomic, strong, readonly)NSString * userId;
|
|
|
/**
|
|
|
* @brief 跑马灯数据
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * marqueeStr;
|
|
|
|
|
|
//videoId
|
|
|
@property (nonatomic, strong, readonly)NSString * videoId;
|
|
|
/**
|
|
|
* @brief 自定义字段,根据自己需求适当添加,比如添加媒体图片,标题等
|
|
|
*/
|
|
|
@property(nonatomic, strong)NSDictionary * othersInfo;
|
|
|
|
|
|
/// 自定义字段 根据自己需求适当添加,比如添加媒体图片,标题等
|
|
|
@property (nonatomic, strong) NSDictionary * othersInfo;
|
|
|
/**
|
|
|
* @brief 解压状态,非点播业务不需要关注此值。0 未解压,1 解压中,2 解压完成,3 解压失败
|
|
|
*/
|
|
|
@property(nonatomic, assign)NSInteger decompressionState;
|
|
|
|
|
|
/// 非点播业务不需要关注此值 解压状态 0 未解压 1 解压中 2 解压完成 3 解压失败
|
|
|
@property (nonatomic, assign) NSInteger decompressionState;
|
|
|
/**
|
|
|
* @brief 下载进度
|
|
|
*/
|
|
|
@property(nonatomic, strong ,readonly)DWDownloadProgress *progress;
|
|
|
|
|
|
/// 下载进度
|
|
|
@property (nonatomic, strong ,readonly) DWDownloadProgress *progress;
|
|
|
/**
|
|
|
* @brief 下载进度更新block
|
|
|
*/
|
|
|
@property(nonatomic, copy)DWDownloadProgressBlock progressBlock;
|
|
|
|
|
|
/// 下载进度更新block
|
|
|
@property (nonatomic, copy) DWDownloadProgressBlock progressBlock;
|
|
|
/// 下载状态更新block
|
|
|
@property (nonatomic, copy) DWDownloadStateBlock stateBlock;
|
|
|
/**
|
|
|
* @brief 下载状态更新block
|
|
|
*/
|
|
|
@property(nonatomic, copy)DWDownloadStateBlock stateBlock;
|
|
|
```
|
|
|
|
|
|
以下是具体DWDownloadProgress中,包含的字段及含义:
|
|
|
```
|
|
|
/// 续传大小
|
|
|
@property (nonatomic, assign, readonly) int64_t resumeBytesWritten;
|
|
|
/**
|
|
|
* @brief 续传大小
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int64_t resumeBytesWritten;
|
|
|
|
|
|
/// 这次写入的数量
|
|
|
@property (nonatomic, assign, readonly) int64_t bytesWritten;
|
|
|
/**
|
|
|
* @brief 每次写入的数量
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int64_t bytesWritten;
|
|
|
|
|
|
/// 已下载的数量
|
|
|
@property (nonatomic, assign, readonly) int64_t totalBytesWritten;
|
|
|
/**
|
|
|
* @brief 已下载的数量
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int64_t totalBytesWritten;
|
|
|
|
|
|
/// 文件的总大小
|
|
|
@property (nonatomic, assign, readonly) int64_t totalBytesExpectedToWrite;
|
|
|
/**
|
|
|
* @brief 文件的总大小
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int64_t totalBytesExpectedToWrite;
|
|
|
|
|
|
/// 下载进度
|
|
|
@property (nonatomic, assign, readonly) float progress;
|
|
|
/**
|
|
|
* @brief 下载进度
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)float progress;
|
|
|
|
|
|
/// 下载速度
|
|
|
@property (nonatomic, assign, readonly) float speed;
|
|
|
/**
|
|
|
* @brief 下载速度
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)float speed;
|
|
|
|
|
|
/// 下载剩余时间
|
|
|
@property (nonatomic, assign, readonly) int remainingTime;
|
|
|
/**
|
|
|
* @brief 下载剩余时间
|
|
|
*/
|
|
|
@property(nonatomic, assign, readonly)int remainingTime;
|
|
|
```
|
|
|
|
|
|
## 2.5 批量下载功能
|
... | ... | @@ -1715,36 +2288,41 @@ DWDownloadModel对象对应具体的下载任务。 |
|
|
具体数据及相关方法如下:
|
|
|
```
|
|
|
/**
|
|
|
1为视频 2为音频 0为视频+音频 若不传该参数默认为视频
|
|
|
* @brief 媒体类型,1为视频 2为音频 0为视频+音频,若不传该参数默认为视频
|
|
|
*/
|
|
|
@property (nonatomic,copy)NSString *mediatype;
|
|
|
@property(nonatomic,copy)NSString *mediatype;
|
|
|
|
|
|
/**
|
|
|
授权验证码,需要的话请设置,默认为空
|
|
|
* @brief 授权验证码,需要的话请设置,默认为空
|
|
|
*/
|
|
|
@property (nonatomic,copy)NSString *verificationCode;
|
|
|
@property(nonatomic,copy)NSString *verificationCode;
|
|
|
|
|
|
//注意! 回调方法可能不在主线程中,如果在里面进行UI操作,请回到主线程中进行
|
|
|
/**
|
|
|
全部视频数据获取出错
|
|
|
* @brief 全部视频数据获取出错
|
|
|
*/
|
|
|
@property (nonatomic,copy)BatchDownloadUtilityErrorBlock errorBlock;
|
|
|
@property(nonatomic,copy)BatchDownloadUtilityErrorBlock errorBlock;
|
|
|
|
|
|
/**
|
|
|
视频数据获取完成
|
|
|
* @brief 视频数据获取完成
|
|
|
*/
|
|
|
@property (nonatomic,copy)BatchDownloadUtilityFinishBlock finishBlock;
|
|
|
@property(nonatomic,copy)BatchDownloadUtilityFinishBlock finishBlock;
|
|
|
|
|
|
/**
|
|
|
* 初始化 会对视频数据进行去重操作,如果传入数组中有重复的视频id或获取某个视频失败,可能会导致最后输出的视频数据长度跟传入的视频id的数量不一致
|
|
|
* @param userId 用户ID,不能为nil
|
|
|
* @param key 用户秘钥,不能为nil
|
|
|
* @param videoIds 视频id数组,不能为nil 最多同时获取10个视频id的播放地址,超出10个按10个获取
|
|
|
*/
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化DWBatchDownloadUtility
|
|
|
* @discussion 会对视频数据进行去重操作,如果传入数组中有重复的视频id或获取某个视频失败,可能会导致最后输出的视频数据长度跟传入的视频id的数量不一致
|
|
|
* @param userId 用户ID,不能为nil
|
|
|
* @param key 用户秘钥,不能为nil
|
|
|
* @param videoIds 视频id数组,不能为nil。最多同时获取10个视频id的播放地址,超出10个按10个获取
|
|
|
* @result DWBatchDownloadUtility对象
|
|
|
*/
|
|
|
-(instancetype)initWithUserId:(NSString *)userId key:(NSString *)key AndVideoIds:(NSArray *)videoIds;
|
|
|
|
|
|
/**
|
|
|
开始获取批量下载数据
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始获取批量下载数据
|
|
|
* @discussion 开始获取批量下载数据
|
|
|
*/
|
|
|
-(void)start;
|
|
|
```
|
... | ... | @@ -1761,59 +2339,60 @@ DWUploadSessionManager是上传管理类,所有有关上传的操作,都是 |
|
|
以下是具体的属性及方法:
|
|
|
|
|
|
```
|
|
|
|
|
|
/**
|
|
|
上传数据列表
|
|
|
* @brief 上传数据列表
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSArray <DWUploadModel *> * uploadModelList;
|
|
|
|
|
|
/**
|
|
|
代理
|
|
|
* @brief 代理
|
|
|
*/
|
|
|
@property(nonatomic,weak) id <DWUploadSessionManagerDelegate> delegate;
|
|
|
|
|
|
/**
|
|
|
初始化DWUploadSessionManager
|
|
|
|
|
|
@return DWUploadSessionManager对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化DWUploadSessionManager
|
|
|
* @discussion 初始化DWUploadSessionManager
|
|
|
* @result DWUploadSessionManager对象
|
|
|
*/
|
|
|
+(DWUploadSessionManager *)manager;
|
|
|
|
|
|
|
|
|
/**
|
|
|
初始化上传对象
|
|
|
|
|
|
@param userId 用户ID,不能为nil
|
|
|
@param apikey 用户秘钥,不能为nil
|
|
|
@param title 视频标题,不能为nil
|
|
|
@param description 视频描述
|
|
|
@param tag 视频标签
|
|
|
@param path 视频路径,不能为nil
|
|
|
@param notifyURL 通知URL
|
|
|
@return 上传对象model
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化上传对象
|
|
|
* @discussion 初始化上传对象
|
|
|
* @param userId 用户ID,不能为nil
|
|
|
* @param apikey 用户秘钥,不能为nil
|
|
|
* @param title 视频标题,不能为nil
|
|
|
* @param description 视频描述
|
|
|
* @param tag 视频标签
|
|
|
* @param path 视频路径,不能为nil
|
|
|
* @param notifyURL 通知URL
|
|
|
* @result DWUploadModel对象
|
|
|
*/
|
|
|
+(DWUploadModel *)createUploadModelWithUserId:(NSString *)userId
|
|
|
Apikey:(NSString *)apikey
|
|
|
VideoTitle:(NSString *)title
|
|
|
VideoDescription:(NSString *)description
|
|
|
VideoTag:(NSString *)tag
|
|
|
VideoPath:(NSString *)videoPath
|
|
|
CategoryId:(NSString *)categoryId
|
|
|
NotifyURL:(NSString *)notifyURL;
|
|
|
|
|
|
/**
|
|
|
添加视频水印,请在调用startWithUploadModel:方法前设置,否则不生效。
|
|
|
|
|
|
@param uploadModel DWUploadModel对象
|
|
|
@param text 水印文字内容, 1-50个字符,数字、字母、汉字,不填写则文字水印不生效
|
|
|
@param corner 水印位置0,左上 1右上 2左下 3右下,默认3,非必填
|
|
|
@param offsetX X轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
@param offsetY Y轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
@param fontFamily 字体类型:0,微软雅黑 1宋体 2黑体,默认0,非必填
|
|
|
@param fontSize 字体大小,[0-100],默认12
|
|
|
@param fontColor 16进制字体颜色,如#FFFFFF,不能写#号,默认灰色D3D3D3,非必填
|
|
|
@param fontAlpha 透明度,[0-100],默认100,100为不透明,非必填
|
|
|
@return 是否设置成功。YES 设置成功,NO 设置失败,参数不合法
|
|
|
Apikey:(NSString *)apikey
|
|
|
VideoTitle:(NSString *)title
|
|
|
VideoDescription:(NSString *)description
|
|
|
VideoTag:(NSString *)tag
|
|
|
VideoPath:(NSString *)videoPath
|
|
|
CategoryId:(NSString *)categoryId
|
|
|
NotifyURL:(NSString *)notifyURL;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 添加视频水印
|
|
|
* @discussion 请在调用startWithUploadModel:方法前设置,否则不生效
|
|
|
* @param uploadModel DWUploadModel对象
|
|
|
* @param text 水印文字内容, 1-50个字符,数字、字母、汉字,不填写则文字水印不生效
|
|
|
* @param corner 水印位置0,左上 1右上 2左下 3右下,默认3,非必填
|
|
|
* @param offsetX X轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
* @param offsetY Y轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
* @param fontFamily 字体类型:0,微软雅黑 1宋体 2黑体,默认0,非必填
|
|
|
* @param fontSize 字体大小,[0-100],默认12
|
|
|
* @param fontColor 16进制字体颜色,如#FFFFFF,不能写#号,默认灰色D3D3D3,非必填
|
|
|
* @param fontAlpha 透明度,[0-100],默认100,100为不透明,非必填
|
|
|
* @result 返回结果
|
|
|
*/
|
|
|
-(BOOL)insertWaterMarkWithUploadModel:(DWUploadModel *)uploadModel
|
|
|
Text:(NSString *)text
|
... | ... | @@ -1825,49 +2404,53 @@ DWUploadSessionManager是上传管理类,所有有关上传的操作,都是 |
|
|
FontColor:(NSString *)fontColor
|
|
|
FontAlpha:(NSNumber *)fontAlpha;
|
|
|
|
|
|
/**
|
|
|
保存视频文件,以供上传使用
|
|
|
|
|
|
@param videoPath 视频文件路径
|
|
|
@return 本地文件路径
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 保存视频文件
|
|
|
* @discussion 保存SDK所使用的视频文件,以供上传使用
|
|
|
* @param videoPath 视频文件路径
|
|
|
* @result SDK所需文件路径
|
|
|
*/
|
|
|
-(NSString *)moveToLocalWithVideoPath:(NSString *)videoPath;
|
|
|
|
|
|
/**
|
|
|
开始上传任务
|
|
|
|
|
|
@param uploadModel DWUploadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始上传任务
|
|
|
* @discussion 开始上传任务
|
|
|
* @param uploadModel DWUploadModel对象
|
|
|
*/
|
|
|
-(void)startWithUploadModel:(DWUploadModel *)uploadModel;
|
|
|
|
|
|
|
|
|
/**
|
|
|
暂停上传任务
|
|
|
|
|
|
@param uploadModel DWUploadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 暂停上传任务
|
|
|
* @discussion 暂停上传任务
|
|
|
* @param uploadModel DWUploadModel对象
|
|
|
*/
|
|
|
-(void)suspendWithUploadModel:(DWUploadModel *)uploadModel;
|
|
|
|
|
|
|
|
|
/**
|
|
|
继续上传任务
|
|
|
|
|
|
@param uploadModel DWUploadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 继续上传任务
|
|
|
* @discussion 继续上传任务
|
|
|
* @param uploadModel DWUploadModel对象
|
|
|
*/
|
|
|
-(void)resumeWithUploadModel:(DWUploadModel *)uploadModel;
|
|
|
|
|
|
/**
|
|
|
删除上传任务
|
|
|
|
|
|
@param uploadModel DWUploadModel对象
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 删除上传任务
|
|
|
* @discussion 删除上传任务
|
|
|
* @param uploadModel DWUploadModel对象
|
|
|
*/
|
|
|
-(void)deleteWithUploadModel:(DWUploadModel *)uploadModel;
|
|
|
|
|
|
/**
|
|
|
获取appdelegate,handleEventsForBackgroundURLSession事件回调
|
|
|
|
|
|
@param identifier identifier
|
|
|
@param completionHandler completionHandler
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 事件透传
|
|
|
* @discussion 获取appdelegate,handleEventsForBackgroundURLSession事件回调
|
|
|
* @param identifier identifier
|
|
|
* @param completionHandler completionHandler
|
|
|
*/
|
|
|
-(void)setUploadSession:(NSString *)identifier CompletionHandler:(void (^)())completionHandler;
|
|
|
|
... | ... | @@ -1877,19 +2460,32 @@ DWUploadSessionManager是上传管理类,所有有关上传的操作,都是 |
|
|
DWUploadSessionManagerDelegate,方法说明如下:
|
|
|
|
|
|
```
|
|
|
//开始上传
|
|
|
/** 开始上传
|
|
|
@param uploadModel 自身对象
|
|
|
*/
|
|
|
-(void)uploadSessionManagerBeginWithUploadModel:(DWUploadModel *)uploadModel;
|
|
|
|
|
|
//更新上传状态
|
|
|
/** 更新上传状态
|
|
|
@param uploadModel 自身对象
|
|
|
@param state 上传状态
|
|
|
*/
|
|
|
-(void)uploadSessionManagerUploadModel:(DWUploadModel *)uploadModel WithState:(DWUploadState)state;
|
|
|
|
|
|
//更新上传进度
|
|
|
/** 更新上传进度
|
|
|
@param uploadModel 自身对象
|
|
|
@param totalBytesSent 已上传文件大小
|
|
|
@param expectedToSend 总文件大小
|
|
|
*/
|
|
|
-(void)uploadSessionManagerUploadModel:(DWUploadModel *)uploadModel totalBytesSent:(int64_t)totalBytesSent WithExpectedToSend:(int64_t)expectedToSend;
|
|
|
|
|
|
//上传失败回调
|
|
|
/** 上传失败回调
|
|
|
@param uploadModel 自身对象
|
|
|
@param error 错误信息
|
|
|
*/
|
|
|
-(void)uploadSessionManagerUploadModel:(DWUploadModel *)uploadModel WithError:(NSError *)error;
|
|
|
|
|
|
//后台任务完成时回调
|
|
|
/** 后台任务完成时回调
|
|
|
*/
|
|
|
-(void)uploadBackgroundSessionCompletion;
|
|
|
|
|
|
```
|
... | ... | @@ -1900,52 +2496,84 @@ DWUploadModel对象对应具体的上传任务。 |
|
|
以下是具体DWUploadModel中,包含的字段及含义:
|
|
|
|
|
|
```
|
|
|
|
|
|
///上传状态
|
|
|
/**
|
|
|
* @brief 上传状态
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)DWUploadState state;
|
|
|
|
|
|
///视频标题
|
|
|
/**
|
|
|
* @brief 视频标题
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * title;
|
|
|
|
|
|
///视频tag
|
|
|
/**
|
|
|
* @brief 视频tag
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * tag;
|
|
|
|
|
|
///视频描述信息
|
|
|
/**
|
|
|
* @brief 视频描述信息
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * desc;
|
|
|
|
|
|
///视频分类
|
|
|
/**
|
|
|
* @brief 视频分类
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * categoryId;
|
|
|
|
|
|
///上传进度
|
|
|
/**
|
|
|
* @brief 上传进度
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)CGFloat progress;
|
|
|
|
|
|
///上传文件总字节数
|
|
|
/**
|
|
|
* @brief 上传文件总字节数
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)int64_t fileSize;
|
|
|
|
|
|
///已上传字节数
|
|
|
/**
|
|
|
* @brief 已上传字节数
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)int64_t totalSentBytes;
|
|
|
|
|
|
///本次发送字节数
|
|
|
/**
|
|
|
* @brief 本次发送字节数
|
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)int64_t sentBytes;
|
|
|
|
|
|
///自定义参数
|
|
|
/**
|
|
|
* @brief 自定义参数
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSDictionary * otherInfo;
|
|
|
|
|
|
///视频id
|
|
|
/**
|
|
|
* @brief 视频id
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * videoId;
|
|
|
|
|
|
///回调地址
|
|
|
/**
|
|
|
* @brief 视频回调地址
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * notifyURL;
|
|
|
|
|
|
///是否裁剪 @"1"为裁剪 @“0”不裁剪 不设置默认为不裁剪
|
|
|
/**
|
|
|
* @brief 是否裁剪 @"1"为裁剪 @“0”不裁剪 不设置默认为不裁剪
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * isCrop;
|
|
|
|
|
|
/**
|
|
|
* @brief ew
|
|
|
*/
|
|
|
@property(nonatomic,copy)NSString * ew;
|
|
|
|
|
|
///账号id
|
|
|
/**
|
|
|
* @brief 账号id
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * userId;
|
|
|
|
|
|
///视频水印
|
|
|
/**
|
|
|
* @brief 视频水印
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)DWUploadWaterMarkModel * waterMark;
|
|
|
|
|
|
```
|
... | ... | @@ -1953,29 +2581,44 @@ DWUploadModel对象对应具体的上传任务。 |
|
|
以下是具体DWUploadWaterMarkModel中,包含的字段及含义:
|
|
|
|
|
|
```
|
|
|
|
|
|
///水印文字内容, 1-50个字符,数字、字母、汉字,不填写则文字水印不生效
|
|
|
/**
|
|
|
* @brief 水印文字内容, 1-50个字符,数字、字母、汉字,不填写则文字水印不生效
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * text;
|
|
|
|
|
|
///水印位置0,左上 1右上 2左下 3右下,默认3,非必填
|
|
|
/**
|
|
|
* @brief 水印位置0,左上 1右上 2左下 3右下,默认3,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * corner;
|
|
|
|
|
|
///X轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
/**
|
|
|
* @brief X轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * offsetX;
|
|
|
|
|
|
///offsetY Y轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
/**
|
|
|
* @brief Y轴偏移像素值,要求大于0,默认值5,超出视频大小按默认值,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * offsetY;
|
|
|
|
|
|
//字体类型:0,微软雅黑 1宋体 2黑体,默认0,非必填
|
|
|
/**
|
|
|
* @brief 字体类型:0,微软雅黑 1宋体 2黑体,默认0,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * fontFamily;
|
|
|
|
|
|
///字体大小,[0-100],默认12
|
|
|
/**
|
|
|
* @brief 字体大小,[0-100],默认12
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * fontSize;
|
|
|
|
|
|
///16进制字体颜色,如#FFFFFF,不能写#号,默认灰色D3D3D3,非必填
|
|
|
/**
|
|
|
* @brief 16进制字体颜色,如#FFFFFF,不能写#号,默认灰色D3D3D3,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSString * fontColor;
|
|
|
|
|
|
///透明度,[0-100],默认100,100为不透明,非必填
|
|
|
/**
|
|
|
* @brief 透明度,[0-100],默认100,100为不透明,非必填
|
|
|
*/
|
|
|
@property(nonatomic,strong,readonly)NSNumber * fontAlpha;
|
|
|
|
|
|
```
|
... | ... | |