|
|
# 开发指南
|
|
|
|
|
|
## 1.播放功能
|
|
|
|
... | ... | @@ -233,6 +234,11 @@ DWPlayerView包含的属性及方法如下: |
|
|
*/
|
|
|
@property(nonatomic,assign,readonly)NSTimeInterval pausedTimes;
|
|
|
|
|
|
/**
|
|
|
* @brief 视频自定义Logo。对于在线视频,直接设置即可显示,对于离线视频,调用playLocalVideo:方法播放时,会自动设置下载视频所设置的Logo,无需手动设置。
|
|
|
*/
|
|
|
@property(nonatomic,strong)DWVideoLogoModel * videoLogo;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 初始化播放对象
|
... | ... | @@ -2012,6 +2018,66 @@ DWBarrageManagerDelegate方法如下: |
|
|
|
|
|
```
|
|
|
|
|
|
## 1.16 自定义LOGO
|
|
|
播放视频时,可以根据不同的设置,来显示不同的logo。
|
|
|
|
|
|
### 1.16.1 自定义LOGO类的说明
|
|
|
```
|
|
|
//自定义视频LOGO
|
|
|
@interface DWVideoLogoModel : NSObject
|
|
|
|
|
|
/**
|
|
|
* @brief 资源地址URL,必填。支持网络URL,本地URL,支持jpg/jpeg/png/gif格式
|
|
|
*/
|
|
|
@property(nonatomic, strong)NSURL * url;
|
|
|
|
|
|
/**
|
|
|
* @brief 下载到本地Logo资源路径
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)NSString * filePath;
|
|
|
|
|
|
/**
|
|
|
* @brief logo坐标百分比,选填,默认值左上角(0.1,0.1)
|
|
|
*/
|
|
|
@property(nonatomic, assign)CGPoint logoOrigin;
|
|
|
|
|
|
/**
|
|
|
* @brief logo大小,相对于DWPlayerView对象size的百分比,选填,默认(0.1,0.1)
|
|
|
*/
|
|
|
@property(nonatomic, assign)CGSize logoSize;
|
|
|
|
|
|
@end
|
|
|
```
|
|
|
|
|
|
### 1.16.2 自定义LOGO功能的使用
|
|
|
1.在线视频设置自定义LOGO
|
|
|
|
|
|
```
|
|
|
//1.生成DWVideoLogoModel对象
|
|
|
DWVideoLogoModel * videoLogo = [[DWVideoLogoModel alloc]init];
|
|
|
videoLogo.url = [NSURL URLWithString:@"网络资源地址"];
|
|
|
//videoLogo.url = [NSURL fileURLWithPath:@"本地资源地址"];
|
|
|
videoLogo.logoOrigin = CGPointMake(0, 0);
|
|
|
videoLogo.logoSize = CGSizeMake(0.2, 0.2);
|
|
|
//2.设置DWPlayerView对象的videoLogo属性
|
|
|
self.playerView.videoLogo = videoLogo;
|
|
|
```
|
|
|
|
|
|
2.离线视频设置自定义LOGO
|
|
|
|
|
|
```
|
|
|
//1.创建DWDownloadModel对象以后,调用insertVideoLogoWithDownloadModel: VideoLogo:方法关联自定义LOGO
|
|
|
DWVideoLogoModel * videoLogo = [[DWVideoLogoModel alloc]init];
|
|
|
videoLogo.url = [NSURL URLWithString:@"网络资源地址"];
|
|
|
//videoLogo.url = [NSURL fileURLWithPath:@"本地资源地址"];
|
|
|
videoLogo.logoOrigin = CGPointMake(0, 0);
|
|
|
videoLogo.logoSize = CGSizeMake(0.2, 0.2);
|
|
|
//关联DWVideoLogoModel对象,会自动下载设置的LOGO对象
|
|
|
[[DWDownloadSessionManager manager insertVideoLogoWithDownloadModel:model VideoLogo:videoLogo];
|
|
|
//2.播放时,调用DWPlayerView对象的playLocalVideo:方法即可显示已下载的LOGO。
|
|
|
|
|
|
```
|
|
|
|
|
|
# 2.下载功能
|
|
|
|
|
|
## 2.1 下载功能的快速集成,请详见2.集成指南
|
... | ... | @@ -2074,6 +2140,16 @@ DWDownloadSessionManager是下载管理类,所有有关下载的操作,都 |
|
|
*/
|
|
|
+(DWDownloadModel *)createDownloadModel:(DWVodVideoModel *)videoMdoel Quality:(NSString *)quality AndOthersInfo:(NSDictionary *)othersInfo;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 插入自定义LOGO
|
|
|
* @discussion 在startWithDownloadModel:方法前调用,否则会导致自定义水印无法正常下载
|
|
|
* @param downloadModel DWDownloadModel对象
|
|
|
* @param videoLogo 自定义水印对象
|
|
|
* @result 插入成功返回YES,失败返回NO
|
|
|
*/
|
|
|
-(BOOL)insertVideoLogoWithDownloadModel:(DWDownloadModel *)downloadModel VideoLogo:(DWVideoLogoModel *)videoLogo;
|
|
|
|
|
|
/*!
|
|
|
* @method
|
|
|
* @abstract 开始下载任务
|
... | ... | @@ -2312,6 +2388,11 @@ DWDownloadModel对象对应具体的下载任务。 |
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoSubtitleModel * subtitle2;
|
|
|
|
|
|
/**
|
|
|
* @brief 自定义LOGO
|
|
|
*/
|
|
|
@property(nonatomic, strong, readonly)DWVideoLogoModel * videoLogo;
|
|
|
|
|
|
/**
|
|
|
* @brief 自定义字段,根据自己需求适当添加,比如添加媒体图片,标题等
|
|
|
*/
|
... | ... | |