Commit 1c3a8555 authored by guow's avatar guow
Browse files

4.15.5

parent d173e612
No preview for this file type
......@@ -299,7 +299,7 @@ static CGFloat barrageBgHeight = 40;
self.isWindowsPlay = NO;
//是否开启画中画
self.allowPictureInPicture = NO;
self.allowPictureInPicture = YES;
//是否自动播放
self.autoPlay = YES;
......@@ -369,6 +369,19 @@ static CGFloat barrageBgHeight = 40;
// [[NSRunLoop mainRunLoop] addTimer:self.testTimer forMode:NSRunLoopCommonModes];
_isAsAllowShow = YES;//默认打开
//画中画同步播放状态
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(openPipAction) name:@"DW_openPIP" object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(closePipAction) name:@"DW_closePIP" object:nil];
}
- (void)openPipAction{
self.playOrPauseButton.selected = YES;
}
- (void)closePipAction{
self.playOrPauseButton.selected = NO;
// [self.playOrPauseButton setImage:[UIImage imageNamed:@"icon_play.png"] forState:UIControlStateSelected];
}
//- (void)handleSiwtchBtn:(UISwitch *)sender{
......@@ -388,6 +401,8 @@ static CGFloat barrageBgHeight = 40;
//移除网络监听
[self.reachability stopNotifier];
self.reachability = nil;
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"DW_openPIP" object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:@"DW_closePIP" object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:kHDReachabilityChangedNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationWillEnterForegroundNotification object:nil];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIApplicationDidEnterBackgroundNotification object:nil];
......@@ -2310,23 +2325,27 @@ static CGFloat barrageBgHeight = 40;
self.timeLabel.hidden = YES;
}
[self funcBgViewIsAppear:YES];//拖动的时候要展示slider
UIImage *image = [self.playerView thumbnailImageForVideoAtTime:time];
self.preViewImage.image = image;
self.timeLabel.text = [NSString stringWithFormat:@"%@/%@", [DWTools formatSecondsToString:time], [DWTools formatSecondsToString:durationInSeconds]];
self.timeLabel.attributedText = [DWTools setTextColor:ColorFrom16A(0xff920a, 1) rangeOfString:[DWTools formatSecondsToString:time] string:self.timeLabel.text textFont:17];
NSInteger integer = time;
for (DWVideoMarkModel *markModel in self.videomarkArray) {//遍历打点的时间点去显示打点描述
if (!self.isFull) {
return;
}
//根据打点时间设置取值范围
if (integer >= markModel.marktime - 6 && integer <= markModel.marktime + 6) {
self.markLabel.text = markModel.markdesc;
break;
}else{
self.markLabel.text = nil;
}
}
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_main_queue(), ^{
UIImage *image = [self.playerView thumbnailImageForVideoAtTime:time];
self.preViewImage.image = image;
self.timeLabel.text = [NSString stringWithFormat:@"%@/%@", [DWTools formatSecondsToString:time], [DWTools formatSecondsToString:durationInSeconds]];
self.timeLabel.attributedText = [DWTools setTextColor:ColorFrom16A(0xff920a, 1) rangeOfString:[DWTools formatSecondsToString:time] string:self.timeLabel.text textFont:17];
NSInteger integer = time;
for (DWVideoMarkModel *markModel in self.videomarkArray) {//遍历打点的时间点去显示打点描述
if (!self.isFull) {
return;
}
//根据打点时间设置取值范围
if (integer >= markModel.marktime - 6 && integer <= markModel.marktime + 6) {
self.markLabel.text = markModel.markdesc;
break;
}else{
self.markLabel.text = nil;
}
}
});
});
}
#pragma mark - 拖动开始
......@@ -2673,17 +2692,17 @@ static CGFloat barrageBgHeight = 40;
weakSelf.markScrubtime =markModel.marktime;
//获取打点的图像
if(self.videomarkArray.count > 0){
NSMutableArray *tempArr = [NSMutableArray array];
for (DWVideoMarkModel *model in self.videomarkArray) {
UIImage *image = [self.playerView thumbnailImageForVideoAtTime:model.marktime];
model.videoImg = image;
[tempArr addObject:model];
}
if(weakSelf.markView.datasource == 0){
weakSelf.markView.datasource = tempArr;
}
}
// if(self.videomarkArray.count > 0){
// NSMutableArray *tempArr = [NSMutableArray array];
// for (DWVideoMarkModel *model in self.videomarkArray) {
// UIImage *image = [self.playerView thumbnailImageForVideoAtTime:model.marktime];
// model.videoImg = image;
// [tempArr addObject:model];
// }
// if(weakSelf.markView.datasource == 0){
// weakSelf.markView.datasource = tempArr;
// }
// }
}
}];
......@@ -2783,9 +2802,9 @@ static CGFloat barrageBgHeight = 40;
#pragma mark - 答题器功能
- (void)showAswerView:(float)time{
NSLog(@"----- gw %f %f %f", self.currentPlayDuration, self.exercisesLastScrubTime, self.drawTime);
// NSLog(@"----- gw %f %f %f", self.currentPlayDuration, self.exercisesLastScrubTime, self.drawTime);
for (DWAnswerModel *answerModel in self.answerArr) {
NSLog(@"++++++++ %@ %d", answerModel.showTime, answerModel.isShow);
// NSLog(@"++++++++ %@ %d", answerModel.showTime, answerModel.isShow);
if (answerModel.showTime.integerValue <= (NSInteger)time && !answerModel.isShow) {
// videoModel.isDrawAllow YES 拖拽的时候不展示答题器
......@@ -2803,7 +2822,7 @@ static CGFloat barrageBgHeight = 40;
}
NSMutableArray *arr = [NSMutableArray array];
[arr addObject:answerModel.showTime];
NSLog(@"播放的时间点 %@", arr);
// NSLog(@"播放的时间点 %@", arr);
[self sendWindowsFuncNotification:NO];
[self destroyFuncTimer];
// [self.playerView scrub:answerModel.showTime.floatValue];
......@@ -3903,6 +3922,19 @@ static CGFloat barrageBgHeight = 40;
//同步视频总时间
self.pan.duration = CMTimeGetSeconds(self.playerView.player.currentItem.duration);
//获取打点的图像
if(self.videomarkArray.count > 0){
NSMutableArray *tempArr = [NSMutableArray array];
for (DWVideoMarkModel *model in self.videomarkArray) {
UIImage *image = [self.playerView thumbnailImageForVideoAtTime:model.marktime];
model.videoImg = image;
[tempArr addObject:model];
}
if(self.markView.datasource == 0){
self.markView.datasource = tempArr;
}
}
}
//播放完毕
......@@ -4464,6 +4496,23 @@ static CGFloat barrageBgHeight = 40;
self.pan.vodPanDelegate = self;
}
- (NSDictionary *)readLocalFileWithName:(NSString *)name
{
// 获取文件路径
NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"json"];
// 将文件数据化
NSData *data = [[NSData alloc] initWithContentsOfFile:path];
return [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:nil];
}
/**
*跑马灯功能:如果需要自定义数据请参考demo中json数据格式
*当有自定义数据的时候优先走自定义数据
*/
-(void)initMarqueeView
{
if (self.marqueeView) {
......@@ -4471,22 +4520,29 @@ static CGFloat barrageBgHeight = 40;
self.marqueeView = nil;
}
NSData * jsonData = nil;
//判断是否是离线视频
if (self.downloadModel) {
//离线视频
jsonData = [self.downloadModel.marqueeStr dataUsingEncoding:NSUTF8StringEncoding];
//当有自定义跑马灯数据的时候优先走自定义数据
NSDictionary *tempDict = [self readLocalFileWithName:@"marquee"];//自定义跑马灯,请按照给出的数据格式
NSDictionary * marqueeSetDict;
if(tempDict && tempDict.count != 0){
marqueeSetDict = tempDict;
}else{
//在线视频
jsonData = [self.videoModel.authorize.marqueeStr dataUsingEncoding:NSUTF8StringEncoding];
}
if (!jsonData) {
return;
NSData * jsonData = nil;
//判断是否是离线视频
if (self.downloadModel) {
//离线视频
jsonData = [self.downloadModel.marqueeStr dataUsingEncoding:NSUTF8StringEncoding];
}else{
//在线视频
jsonData = [self.videoModel.authorize.marqueeStr dataUsingEncoding:NSUTF8StringEncoding];
}
if (!jsonData) {
return;
}
marqueeSetDict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
}
NSDictionary * marqueeSetDict = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingMutableLeaves error:nil];
CGFloat width = 0.0;
CGFloat height = 0.0;
......@@ -4881,7 +4937,7 @@ static CGFloat barrageBgHeight = 40;
{
if (!_speedArray) {
_speedArray = [[NSMutableArray alloc]init];
NSArray * titles = @[@"0.5X",@"1.0X",@"1.5X",@"2.0X",@"3.0X"];
NSArray * titles = @[@"0.5X",@"1.0X",@"1.5X",@"2.0X"];
[titles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
DWTableChooseModel * chooseModel = [[DWTableChooseModel alloc]init];
chooseModel.title = (NSString *)obj;
......
//版本号
#define SDK_VERSION @"4.15.4"
#define SDK_VERSION @"4.15.5"
#import <CCVodSDK/DWGIFManager.h>
#import <CCVodSDK/DWAdInfo.h>
......
//版本号
#define SDK_VERSION @"4.15.4"
#define SDK_VERSION @"4.15.5"
#import <CCVodSDK/DWGIFManager.h>
#import <CCVodSDK/DWAdInfo.h>
......
//版本号
#define SDK_VERSION @"4.15.4"
#define SDK_VERSION @"4.15.5"
#import <CCVodSDK/DWGIFManager.h>
#import <CCVodSDK/DWAdInfo.h>
......
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