Commit 280878c3 authored by Han Ruisong's avatar Han Ruisong
Browse files

升级到v4.2.0

1.新增视频防录屏功能。
2.新增视频动态水印。
3.优化离线视频播放流程。
4.优化下载暂停流程。
parent 8d4e0972
No preview for this file type
This diff is collapsed.
......@@ -2,4 +2,38 @@
<Bucket
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/SDK/Upload/DWUploader.m"
timestampString = "586675223.9752491"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "649"
endingLineNumber = "649"
landmarkName = "-accessCheckUploadWithFirst:"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/SDK/Upload/DWUploader.m"
timestampString = "586675223.976321"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "554"
endingLineNumber = "554"
landmarkName = "-accessUploadValidate"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -173,11 +173,7 @@
if (self.totolButton.selected) {
//暂停
for (DWDownloadModel * downloadModel in self.downloadList) {
if (downloadModel.state == DWDownloadStateRunning) {
[self.manager suspendWithDownloadModel:downloadModel];
}
}
[self.manager suspendAllDownloadModel];
}else{
//开始
for (DWDownloadModel * downloadModel in self.downloadList) {
......
......@@ -92,8 +92,8 @@
-(void)reloadLoaclData
{
//请自行替换数据
NSArray * videos = @[];
NSArray * videos = @[@""];
for (int i = 0; i < videos.count; i++) {
DWVodModel * vodModel = [[DWVodModel alloc]init];
vodModel.videoId = [videos objectAtIndex:i];
......
......@@ -238,6 +238,16 @@ static NSString *const uploadsArray =@"uploadsArray";
videoPath:model.videoPath
notifyURL:@"http://www.bokecc.com/"];
//若需添加视频动态水印,请取消注释并修改参数即可
// [uploader insertWaterMarkWithText:@"视频动态水印"
// Corner:@0
// OffsetX:@5
// OffsetY:@5
// FontFamily:@0
// FontSize:@20
// FontColor:@"FF00FF"
// FontAlpha:@90];
__weak typeof(self) weakSelf = self;
uploader.delegate =self;
uploader.progressBlock = ^(float progress, NSInteger totalBytesWritten, NSInteger totalBytesExpectedToWrite) {
......
......@@ -2736,6 +2736,8 @@ static const CGFloat gifSeconds = 0.25;
// self.playerView.loadStyle = DWPlayerViewLoadStyleImmediately;
self.playerView.forwardBufferDuration = 30;
self.playerView.delegate = self;
//是否开启防录屏
// self.playerView.videoProtect = YES;
[self insertSubview:self.playerView atIndex:0];
[_playerView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
......
//
// DWUploadWaterMarkSettingView.h
// Demo
//
// Created by zwl on 2019/8/1.
// Copyright © 2019 com.bokecc.www. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface DWUploadWaterMarkSettingView : UIView
@property(nonatomic,strong,readonly)NSDictionary * waterMarkParams;
-(void)show;
@end
NS_ASSUME_NONNULL_END
//
// DWUploadWaterMarkSettingView.m
// Demo
//
// Created by zwl on 2019/8/1.
// Copyright © 2019 com.bokecc.www. All rights reserved.
//
#import "DWUploadWaterMarkSettingView.h"
@interface DWUploadWaterMarkSettingView ()
@property(nonatomic,strong)UIView * maskView;
@property(nonatomic,strong)UIView * bgView;
@end
@implementation DWUploadWaterMarkSettingView
-(instancetype)init
{
if (self == [super init]) {
[self initUI];
}
return self;
}
-(void)show
{
[[UIApplication sharedApplication].keyWindow addSubview:self];
[self mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.and.right.equalTo(@0);
make.top.and.bottom.equalTo(@0);
}];
}
-(void)dismiss
{
[self removeFromSuperview];
}
-(NSDictionary *)waterMarkParams
{
NSDictionary * retDict = @{@"text": ((UITextField *)[self.bgView viewWithTag:100 + 0]).text,
@"corner":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 1]).text integerValue]],
@"offsetX":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 2]).text integerValue]],
@"offsetY":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 3]).text integerValue]],
@"fontFamily":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 4]).text integerValue]],
@"fontSize":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 5]).text integerValue]],
@"fontColor":((UITextField *)[self.bgView viewWithTag:100 + 6]).text,
@"fontAlpha":[NSNumber numberWithInteger:[((UITextField *)[self.bgView viewWithTag:100 + 7]).text integerValue]]};
return retDict;
}
#pragma mark - init
-(void)initUI
{
UITapGestureRecognizer * dismissTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(dismiss)];
[self addGestureRecognizer:dismissTap];
self.maskView = [[UIView alloc]init];
self.maskView.backgroundColor = [UIColor colorWithRed:0 green:0 blue:0 alpha:0.65];
[self addSubview:self.maskView];
[_maskView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self);
}];
CGFloat textFieldHeight = 44;
self.bgView = [[UIView alloc]init];
self.backgroundColor = [UIColor whiteColor];
[self addSubview:self.bgView];
[_bgView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self);
make.top.equalTo(@100);
make.width.equalTo(@(ScreenWidth - 20));
make.height.equalTo(@(textFieldHeight * 8));
}];
NSArray * pTitles = @[@"水印内容",@"水印位置(0,左上 1右上 2左下 3右下,默认3)",@"X轴偏移量(要求大于0,默认值5)",@"Y轴偏移量(要求大于0,默认值5)",@"字体类型(0,微软雅黑 1宋体 2黑体,默认0)",@"字体大小([0-100],默认12)",@"字体颜色(如FFFFFF)",@"字体透明度([0-100],默认100,100为不透明)"];
NSArray * titles = @[@"",@"0",@"5",@"5",@"0",@"12",@"FFFFFF",@"100"];
for (int i = 0; i < pTitles.count; i++) {
UITextField * textField = [[UITextField alloc]init];
textField.backgroundColor = [UIColor whiteColor];
textField.placeholder = [pTitles objectAtIndex:i];
textField.font = TitleFont(14);
textField.textColor = TitleColor_51;
textField.tag = 100 + i;
textField.text = [titles objectAtIndex:i];
[self.bgView addSubview:textField];
[textField mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.equalTo(@16);
make.right.equalTo(@(-16));
make.top.equalTo(@(textFieldHeight * i));
make.height.equalTo(@(textFieldHeight));
}];
}
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
......@@ -16,7 +16,7 @@
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
[DWLog setIsDebugHttpLog:YES];
//设置AVAudioSession
NSError *categoryError = nil;
BOOL success = [[AVAudioSession sharedInstance] setCategory:AVAudioSessionCategoryPlayback error:&categoryError];
......
......@@ -24,9 +24,10 @@
-(instancetype)init
{
if (self == [super init]) {
self.DWAccount_userId = @"391E6E3340A00767";
self.DWAccount_apikey = @"T8WdOUuvFEiOsou1xjDr4U73v12M7iNa";
self.isOpenAd = NO;
}
return self;
......
......@@ -120,6 +120,11 @@
*/
-(void)deleteWithDownloadModel:(DWDownloadModel *)downloadModel;
/**
暂停全部任务
*/
-(void)suspendAllDownloadModel;
/**
删除全部任务
*/
......
......@@ -113,11 +113,16 @@ typedef NS_ENUM(NSUInteger, DWPlayerViewLoadStyle) {
*/
@property(nonatomic,assign)DWPlayerViewLoadStyle loadStyle;
/**
是否开启防录屏模式,默认为NO。
注意:此属性仅针对iOS11以上系统生效。
*/
@property(nonatomic,assign)BOOL videoProtect;
/**
期待缓冲时长 默认 0,建议取值1 ~ 50 。
注意:此属性仅针对iOS10以上系统, m3u8格式视频有效。
*/
@property(nonatomic,assign)NSTimeInterval forwardBufferDuration;
/**
......
......@@ -23,5 +23,5 @@
#import "DWVodAdInfoModel.h"
//版本号
#define SDK_VERSION @"4.1.0"
#define SDK_VERSION @"4.2.0"
......@@ -106,17 +106,40 @@ typedef void (^DWErrorBlock)(NSError *error);
notifyURL:(NSString *)notifyURL;
/**
* @brief 重新初始化上传对象
*
* @param videoContext 通过 videoContextTryBlock 获取的视频上传上下文。
* 使用该方法重新初始化 uploader,调用 resume 方法继续上传。
*
* 如果 videoContextTryBlock 未调用,则需要通过 initWithUserId:... 方法重新初始化对象,调用 start 重新上传。
*
* @return 成功返回上传对象,如果 videoContext 无效,则初始化失败,返回nil。
重新初始化上传对象
@param videoContext 通过 videoContextTryBlock 获取的视频上传上下文。
使用该方法重新初始化 uploader,调用 resume 方法继续上传。
如果 videoContextTryBlock 未调用,则需要通过 initWithUserId:... 方法重新初始化对象,调用 start 重新上传。
@return 成功返回上传对象,如果 videoContext 无效,则初始化失败,返回nil。
*/
- (id)initWithVideoContext:(NSDictionary *)videoContext;
/**
添加视频水印,请在上传开始前调用此方法。
@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 设置失败,参数不合法
*/
-(BOOL)insertWaterMarkWithText:(NSString *)text
Corner:(NSNumber *)corner
OffsetX:(NSNumber *)offsetX
OffsetY:(NSNumber *)offsetY
FontFamily:(NSNumber *)fontFamily
FontSize:(NSNumber *)fontSize
FontColor:(NSString *)fontColor
FontAlpha:(NSNumber *)fontAlpha;
/**
iscrop: @"1"为裁剪 @“0”不裁剪 不设置默认为不裁剪
*/
......
No preview for this file type
......@@ -493,6 +493,6 @@ header, .context-menu, .megamenu-content, footer{
</style>
</head>
<body class='typora-export' >
<div id='write' class = 'is-mac'><h1><a name="%E6%A6%82%E8%BF%B0" class="md-header-anchor"></a><span>概述</span></h1><h2><a name="sdk%E7%AE%80%E4%BB%8B" class="md-header-anchor"></a><span>SDK简介</span></h2><p><span>iOS点播SDK是适用于iOS平台的云点播SDK。使用此SDK可以与CC视频云服务进行对接,在iOS端使用CC视频的点播功能。</span></p><h2><a name="%E8%AE%BE%E5%A4%87%E5%8F%8A%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83" class="md-header-anchor"></a><span>设备及开发环境</span></h2><p><span>Xcode 集成开发环境。</span></p><p><span>iOS 运行环境:iOS 8.0 及以上系统,armv7、arm64、x86_64的CPU架构。</span></p><h2><a name="%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7" class="md-header-anchor"></a><span>功能特性</span></h2><figure><table><thead><tr><th><span>功能</span></th><th style='text-align:left;' ><span>描述</span></th></tr></thead><tbody><tr><td><span>播放功能</span></td><td style='text-align:left;' ><span>支持加密/非加密音视频在线和本地播放</span></td></tr><tr><td><span>广告功能</span></td><td style='text-align:left;' ><span>支持添加视频前贴广告和暂停广告</span></td></tr><tr><td><span>播放统计</span></td><td style='text-align:left;' ><span>支持用户实现播放的统计</span></td></tr><tr><td><span>视频打点</span></td><td style='text-align:left;' ><span>支持用户自定义视频打点功能</span></td></tr><tr><td><span>视频问答</span></td><td style='text-align:left;' ><span>支持用户自定义问答功能</span></td></tr><tr><td><span>视频字幕</span></td><td style='text-align:left;' ><span>支持从服务器获取字幕资源并显示</span></td></tr><tr><td><span>授权验证</span></td><td style='text-align:left;' ><span>支持设置视频是否允许预览</span></td></tr><tr><td><span>原片播放</span></td><td style='text-align:left;' ><span>支持视频上传之后,立即播放</span></td></tr><tr><td><span>访客信息收集</span></td><td style='text-align:left;' ><span>支持访客信息收集功能</span></td></tr><tr><td><span>课堂练习</span></td><td style='text-align:left;' ><span>支持课堂练习功能</span></td></tr><tr><td><span>播放器皮肤</span></td><td style='text-align:left;' ><span>支持带皮肤的播放页面</span></td></tr><tr><td><span>视频投屏</span></td><td style='text-align:left;' ><span>支持DLNA投屏</span></td></tr><tr><td><span>VR视频</span></td><td style='text-align:left;' ><span>支持VR视频播放</span></td></tr><tr><td><span>GIF录制</span></td><td style='text-align:left;' ><span>支持GIF录制功能</span></td></tr><tr><td><span>上传功能</span></td><td style='text-align:left;' ><span>支持音视频上传、断点上传功能</span></td></tr><tr><td><span>下载功能</span></td><td style='text-align:left;' ><span>支持音视频上传、断点下载、批量下载功能</span></td></tr></tbody></table></figure><p>&nbsp;</p></div>
<div id='write' class = 'is-mac'><h1><a name="%E6%A6%82%E8%BF%B0" class="md-header-anchor"></a><span>概述</span></h1><h2><a name="sdk%E7%AE%80%E4%BB%8B" class="md-header-anchor"></a><span>SDK简介</span></h2><p><span>iOS点播SDK是适用于iOS平台的云点播SDK。使用此SDK可以与CC视频云服务进行对接,在iOS端使用CC视频的点播功能。</span></p><h2><a name="%E8%AE%BE%E5%A4%87%E5%8F%8A%E5%BC%80%E5%8F%91%E7%8E%AF%E5%A2%83" class="md-header-anchor"></a><span>设备及开发环境</span></h2><p><span>Xcode 集成开发环境。</span></p><p><span>iOS 运行环境:iOS 8.0 及以上系统,armv7、arm64、x86_64的CPU架构。</span></p><h2><a name="%E5%8A%9F%E8%83%BD%E7%89%B9%E6%80%A7" class="md-header-anchor"></a><span>功能特性</span></h2><figure><table><thead><tr><th><span>功能</span></th><th style='text-align:left;' ><span>描述</span></th></tr></thead><tbody><tr><td><span>播放功能</span></td><td style='text-align:left;' ><span>支持加密/非加密音视频在线和本地播放</span></td></tr><tr><td><span>广告功能</span></td><td style='text-align:left;' ><span>支持添加视频前贴广告和暂停广告</span></td></tr><tr><td><span>播放统计</span></td><td style='text-align:left;' ><span>支持用户实现播放的统计</span></td></tr><tr><td><span>视频打点</span></td><td style='text-align:left;' ><span>支持用户自定义视频打点功能</span></td></tr><tr><td><span>视频问答</span></td><td style='text-align:left;' ><span>支持用户自定义问答功能</span></td></tr><tr><td><span>视频字幕</span></td><td style='text-align:left;' ><span>支持从服务器获取字幕资源并显示</span></td></tr><tr><td><span>授权验证</span></td><td style='text-align:left;' ><span>支持设置视频是否允许预览</span></td></tr><tr><td><span>原片播放</span></td><td style='text-align:left;' ><span>支持视频上传之后,立即播放</span></td></tr><tr><td><span>访客信息收集</span></td><td style='text-align:left;' ><span>支持访客信息收集功能</span></td></tr><tr><td><span>课堂练习</span></td><td style='text-align:left;' ><span>支持课堂练习功能</span></td></tr><tr><td><span>播放器皮肤</span></td><td style='text-align:left;' ><span>支持带皮肤的播放页面</span></td></tr><tr><td><span>视频投屏</span></td><td style='text-align:left;' ><span>支持DLNA投屏</span></td></tr><tr><td><span>防录屏</span></td><td style='text-align:left;' ><span>支持视频防录屏功能</span></td></tr><tr><td><span>动态水印</span></td><td style='text-align:left;' ><span>支持上传视频时,添加动态水印</span></td></tr><tr><td><span>VR视频</span></td><td style='text-align:left;' ><span>支持VR视频播放</span></td></tr><tr><td><span>GIF录制</span></td><td style='text-align:left;' ><span>支持GIF录制功能</span></td></tr><tr><td><span>上传功能</span></td><td style='text-align:left;' ><span>支持音视频上传、断点上传功能</span></td></tr><tr><td><span>下载功能</span></td><td style='text-align:left;' ><span>支持音视频上传、断点下载、批量下载功能</span></td></tr></tbody></table></figure><p>&nbsp;</p></div>
</body>
</html>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment