Commit 7d7f493c authored by Han Ruisong's avatar Han Ruisong
Browse files

升级到v4.4.0

1.新增音频统计功能。
2.新增跑马灯功能。
parent 362fcbae
No preview for this file type
This diff is collapsed.
......@@ -3,4 +3,22 @@
uuid = "D493E4A5-FF32-4C5D-B61B-0D88D4BD1AD4"
type = "1"
version = "2.0">
<Breakpoints>
<BreakpointProxy
BreakpointExtensionID = "Xcode.Breakpoint.FileBreakpoint">
<BreakpointContent
uuid = "AFBDA185-F80C-4FB7-9C05-D31B5996C717"
shouldBeEnabled = "No"
ignoreCount = "0"
continueAfterRunningActions = "No"
filePath = "Demo/Plugins/HDMarqueeView.m"
startingColumnNumber = "9223372036854775807"
endingColumnNumber = "9223372036854775807"
startingLineNumber = "118"
endingLineNumber = "118"
landmarkName = "-stopMarquee"
landmarkType = "7">
</BreakpointContent>
</BreakpointProxy>
</Breakpoints>
</Bucket>
......@@ -28,7 +28,7 @@
[super viewDidLoad];
[self initUI];
// Uncomment the following line to preserve selection between presentations
// self.clearsSelectionOnViewWillAppear = NO;
......
......@@ -163,6 +163,9 @@
//@property(nonatomic,strong)UILabel * testLabel;
//@property(nonatomic,strong)NSTimer * testTimer;
//**************************** marquee ****************************
@property(nonatomic,strong)HDMarqueeView * marqueeView;
@end
@implementation DWVodPlayerView
......@@ -198,6 +201,8 @@ static const CGFloat gifSeconds = 0.25;
[self initRadioView];
[self initFuncGesture];
[self initAirPlayView];
//开启跑马灯功能
// [self initMarqueeView];
//初始化时,默认竖屏设置
[self hideAndClearNotNecessaryView];
......@@ -310,6 +315,10 @@ static const CGFloat gifSeconds = 0.25;
[self hideAndClearNotNecessaryView];
[self updateConstraintsAndHidden];
if (self.marqueeView) {
[self.marqueeView startMarquee];
}
}
-(void)play
......@@ -2950,6 +2959,120 @@ static const CGFloat gifSeconds = 0.25;
}];
}
-(void)initMarqueeView
{
NSData * jsonData = [[NSData alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"marquee" ofType:@"json"]];
NSDictionary * marqueeSetDict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
if (!marqueeSetDict) {
return;
}
//解析数据格式如下
/*
{
"loop": 0,
"type": "text",
"text": {
"content": "<<<我是跑马灯>>>",
"font_size": 20,
"color": "0x008800"
},
"image": {
"image_url": "abc.jpg",
"width": 300,
"height": 22
},
"action": [{
"duration": 3,
"start": {
"xpos": 0.012,
"ypos": 0,
"alpha": 0.8
},
"end": {
"xpos": 0.912,
"ypos": 0.823,
"alpha": 0.8
}
}, {
"duration": 5,
"start": {
"xpos": 0.312,
"ypos": 0.823,
"alpha": 0.8
},
"end": {
"xpos": 0.912,
"ypos": 0.123,
"alpha": 0.2
}
}]
}
*/
CGFloat width = 0.0;
CGFloat height = 0.0;
self.marqueeView = [[HDMarqueeView alloc]init];
HDMarqueeViewStyle style = [[marqueeSetDict objectForKey:@"type"] isEqualToString:@"text"] ? HDMarqueeViewStyleTitle : HDMarqueeViewStyleImage;
self.marqueeView.style = style;
self.marqueeView.fatherView = self.playerView;
self.marqueeView.repeatCount = [[marqueeSetDict objectForKey:@"loop"] integerValue];
if (style == HDMarqueeViewStyleTitle) {
NSDictionary * textDict = [marqueeSetDict objectForKey:@"text"];
NSString * text = [textDict objectForKey:@"content"];
UIColor * textColor = [DWTools colorWithHexString:[textDict objectForKey:@"color"]];
UIFont * textFont = [UIFont systemFontOfSize:[[textDict objectForKey:@"font_size"] floatValue]];
self.marqueeView.text = text;
self.marqueeView.textAttributed = @{NSFontAttributeName:textFont,NSForegroundColorAttributeName:textColor};
CGSize textSize = [self.marqueeView.text calculateRectWithSize:CGSizeMake(ScreenWidth, ScreenHeight) Font:textFont WithLineSpace:0];
width = textSize.width;
height = textSize.height;
}else{
NSDictionary * imageDict = [marqueeSetDict objectForKey:@"image"];
NSURL * imageURL = [NSURL URLWithString:[imageDict objectForKey:@"image_url"]];
self.marqueeView.imageURL = imageURL;
width = [[imageDict objectForKey:@"width"] floatValue];
height = [[imageDict objectForKey:@"height"] floatValue];
}
self.marqueeView.frame = CGRectMake(0, 0, width, height);
//处理action
NSArray * setActionsArray = [marqueeSetDict objectForKey:@"action"];
NSMutableArray <HDMarqueeAction *> * actions = [NSMutableArray array];
for (int i = 0; i < setActionsArray.count; i++) {
NSDictionary * actionDict = [setActionsArray objectAtIndex:i];
CGFloat duration = [[actionDict objectForKey:@"duration"] floatValue];
NSDictionary * startDict = [actionDict objectForKey:@"start"];
NSDictionary * endDict = [actionDict objectForKey:@"end"];
HDMarqueeAction * marqueeAction = [[HDMarqueeAction alloc]init];
marqueeAction.duration = duration;
marqueeAction.startPostion.alpha = [[startDict objectForKey:@"alpha"] floatValue];
marqueeAction.startPostion.pos = CGPointMake([[startDict objectForKey:@"xpos"] floatValue], [[startDict objectForKey:@"ypos"] floatValue]);
marqueeAction.endPostion.alpha = [[endDict objectForKey:@"alpha"] floatValue];
marqueeAction.endPostion.pos = CGPointMake([[endDict objectForKey:@"xpos"] floatValue], [[endDict objectForKey:@"ypos"] floatValue]);
[actions addObject:marqueeAction];
}
// NSLog(@"marqueeView actions : %@",actions);
self.marqueeView.actions = actions;
[self.playerView insertSubview:self.marqueeView atIndex:0];
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(1 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
[self.marqueeView startMarquee];
});
// [self.marqueeView startMarquee];
}
#pragma mark - lazyLoad
//顶部
-(DWPlayerFuncBgView *)topFuncBgView
......
......@@ -24,7 +24,7 @@
-(instancetype)init
{
if (self == [super init]) {
self.DWAccount_userId = @"391E6E3340A00767";
self.DWAccount_apikey = @"T8WdOUuvFEiOsou1xjDr4U73v12M7iNa";
......
......@@ -53,3 +53,5 @@
#import "DWVodModel.h"
#import "DWConfigurationManager.h"
#import "UIImageView+WebCache.h"
#import <HDMarqueeTool/HDMarqueeTool.h>
//
// HDMarqueeAction.h
// HDMarqueeTool
//
// Created by zwl on 2020/3/10.
// Copyright © 2020 zwl. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
@class HDMarqueeActionPosition;
///跑马灯动作
@interface HDMarqueeAction : NSObject
//持续时间
@property(nonatomic,assign)CGFloat duration;
//动作开始时坐标位置
@property(nonatomic,strong,readonly)HDMarqueeActionPosition * startPostion;
//动作结束时坐标位置
@property(nonatomic,strong,readonly)HDMarqueeActionPosition * endPostion;
@end
///用于记录每次的位置
@interface HDMarqueeActionPosition : NSObject
///坐标位置,取值范围0 - 1,例如(0.5,0.5)
@property(nonatomic,assign)CGPoint pos;
///透明度,取值范围 0 - 1
@property(nonatomic,assign)CGFloat alpha;
@end
//
// HDMarqueeTool.h
// HDMarqueeTool
//
// Created by zwl on 2020/3/9.
// Copyright © 2020 zwl. All rights reserved.
//
#import <Foundation/Foundation.h>
//! Project version number for HDMarqueeTool.
FOUNDATION_EXPORT double HDMarqueeToolVersionNumber;
//! Project version string for HDMarqueeTool.
FOUNDATION_EXPORT const unsigned char HDMarqueeToolVersionString[];
// In this header, you should import all the public headers of your framework using statements like #import <HDMarqueeTool/PublicHeader.h>
#import "HDMarqueeView.h"
#import "HDMarqueeAction.h"
//
// HDMarqueeView.h
// HDMarqueeTool
//
// Created by zwl on 2020/3/9.
// Copyright © 2020 zwl. All rights reserved.
//
#import <UIKit/UIKit.h>
#import <QuartzCore/QuartzCore.h>
@class HDMarqueeAction;
typedef NS_ENUM(NSUInteger, HDMarqueeViewStyle) {
HDMarqueeViewStyleTitle,//文字样式
HDMarqueeViewStyleImage //图片样式
};
///跑马灯控件
@interface HDMarqueeView : UIView
///开始跑马灯
-(void)startMarquee;
///结束跑马灯
-(void)stopMarquee;
///父视图,必填
@property(nonatomic,assign)UIView * fatherView;
///跑马灯样式,默认文字样式
@property(nonatomic,assign)HDMarqueeViewStyle style;
///跑马灯文字内容
@property(nonatomic,copy)NSString * text;
///跑马灯文字格式
@property(nonatomic,copy)NSDictionary * textAttributed;
///跑马灯文字对齐方式,默认kCAAlignmentNatural
@property(nonatomic,copy)NSString * textAlignmentMode;
///跑马灯文字显示不全时,裁剪方式,默认kCATruncationNone
@property(nonatomic,copy)NSString * textTruncationMode;
///跑马灯文字是否自动换行,默认NO
@property(nonatomic,assign)BOOL wrapped;
///跑马灯图片
@property(nonatomic,strong)NSURL * imageURL;
///跑马灯效果,必填
@property(nonatomic,strong)NSArray <HDMarqueeAction *> * actions;
///循环次数,默认1,0表示无限循环
@property(nonatomic,assign)NSInteger repeatCount;
@end
framework module HDMarqueeTool {
umbrella header "HDMarqueeTool.h"
export *
module * { export * }
}
......@@ -26,5 +26,5 @@
#import "DWVodAdInfoModel.h"
//版本号
#define SDK_VERSION @"4.3.1"
#define SDK_VERSION @"4.4.0"
No preview for this file type
{
"loop": -1,
"type": "text",
"text": {
"content": "<<<我是跑马灯>>>",
"font_size": 20,
"color": "0x008800"
},
"image": {
"image_url": "https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1583841662861&di=d6d270ab4786cee02b222b3cf1c4f43e&imgtype=0&src=http%3A%2F%2Fi0.hdslb.com%2Fbfs%2Farticle%2F3d0737c5cc6379f36308d7d1da390bf8654861ab.jpg",
"width": 120,
"height": 77
},
"action": [{
"duration": 3,
"start": {
"xpos": 0.012,
"ypos": 0,
"alpha": 0.8
},
"end": {
"xpos": 0.912,
"ypos": 0.823,
"alpha": 0.8
}
}, {
"duration": 5,
"start": {
"xpos": 0.312,
"ypos": 0.823,
"alpha": 0.8
},
"end": {
"xpos": 0.912,
"ypos": 0.123,
"alpha": 0.2
}
}]
}
......@@ -500,6 +500,6 @@ header, .context-menu, .megamenu-content, footer{
</style>
</head>
<body class='typora-export' >
<div id='write' class = 'is-mac'><h1><a name="概述" class="md-header-anchor"></a><span>概述</span></h1><h2><a name="sdk简介" class="md-header-anchor"></a><span>SDK简介</span></h2><p><span>iOS点播SDK是适用于iOS平台的云点播SDK。使用此SDK可以与CC视频云服务进行对接,在iOS端使用CC视频的点播功能。</span></p><h2><a name="设备及开发环境" 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="功能特性" 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><tr><td><span>画中画功能</span></td><td style='text-align:left;' ><span>支持iPad画中画播放</span></td></tr></tbody></table></figure><p>&nbsp;</p></div>
<div id='write' class = 'is-mac'><h1><a name="概述" class="md-header-anchor"></a><span>概述</span></h1><h2><a name="sdk简介" class="md-header-anchor"></a><span>SDK简介</span></h2><p><span>iOS点播SDK是适用于iOS平台的云点播SDK。使用此SDK可以与CC视频云服务进行对接,在iOS端使用CC视频的点播功能。</span></p><h2><a name="设备及开发环境" 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="功能特性" 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><tr><td><span>画中画功能</span></td><td style='text-align:left;' ><span>支持iPad画中画播放</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