Commit b4c4618b authored by guow's avatar guow
Browse files

4.16.0

parent d021faa7
No preview for this file type
...@@ -409,6 +409,7 @@ ...@@ -409,6 +409,7 @@
B57CC7BE18E2E575001A1696 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B57CC7BD18E2E575001A1696 /* CoreLocation.framework */; }; B57CC7BE18E2E575001A1696 /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B57CC7BD18E2E575001A1696 /* CoreLocation.framework */; };
B57CC7C018E2E581001A1696 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B57CC7BF18E2E581001A1696 /* AVFoundation.framework */; }; B57CC7C018E2E581001A1696 /* AVFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B57CC7BF18E2E581001A1696 /* AVFoundation.framework */; };
B88562A41DED1AC8008D1763 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B88562A31DED1AC8008D1763 /* SystemConfiguration.framework */; }; B88562A41DED1AC8008D1763 /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B88562A31DED1AC8008D1763 /* SystemConfiguration.framework */; };
C4F90D572864560B008A1E38 /* HDSSiginVIew.m in Sources */ = {isa = PBXBuildFile; fileRef = C4F90D552864560B008A1E38 /* HDSSiginVIew.m */; };
DD25727D24F79DED00D9BB55 /* icon_exercises_close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DD25727B24F79DED00D9BB55 /* icon_exercises_close@3x.png */; }; DD25727D24F79DED00D9BB55 /* icon_exercises_close@3x.png in Resources */ = {isa = PBXBuildFile; fileRef = DD25727B24F79DED00D9BB55 /* icon_exercises_close@3x.png */; };
DD25727E24F79DED00D9BB55 /* icon_exercises_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DD25727C24F79DED00D9BB55 /* icon_exercises_close@2x.png */; }; DD25727E24F79DED00D9BB55 /* icon_exercises_close@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = DD25727C24F79DED00D9BB55 /* icon_exercises_close@2x.png */; };
DD383817264E5844006A48EE /* vrlibraw.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DD383815264E5844006A48EE /* vrlibraw.bundle */; }; DD383817264E5844006A48EE /* vrlibraw.bundle in Resources */ = {isa = PBXBuildFile; fileRef = DD383815264E5844006A48EE /* vrlibraw.bundle */; };
...@@ -1010,6 +1011,8 @@ ...@@ -1010,6 +1011,8 @@
B57CC7BD18E2E575001A1696 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; }; B57CC7BD18E2E575001A1696 /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
B57CC7BF18E2E581001A1696 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; }; B57CC7BF18E2E581001A1696 /* AVFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AVFoundation.framework; path = System/Library/Frameworks/AVFoundation.framework; sourceTree = SDKROOT; };
B88562A31DED1AC8008D1763 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; B88562A31DED1AC8008D1763 /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
C4F90D552864560B008A1E38 /* HDSSiginVIew.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HDSSiginVIew.m; sourceTree = "<group>"; };
C4F90D562864560B008A1E38 /* HDSSiginVIew.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HDSSiginVIew.h; sourceTree = "<group>"; };
DD25727B24F79DED00D9BB55 /* icon_exercises_close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_exercises_close@3x.png"; sourceTree = "<group>"; }; DD25727B24F79DED00D9BB55 /* icon_exercises_close@3x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_exercises_close@3x.png"; sourceTree = "<group>"; };
DD25727C24F79DED00D9BB55 /* icon_exercises_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_exercises_close@2x.png"; sourceTree = "<group>"; }; DD25727C24F79DED00D9BB55 /* icon_exercises_close@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "icon_exercises_close@2x.png"; sourceTree = "<group>"; };
DD383811264E5839006A48EE /* CCVodSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CCVodSDK.framework; sourceTree = "<group>"; }; DD383811264E5839006A48EE /* CCVodSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = CCVodSDK.framework; sourceTree = "<group>"; };
...@@ -1091,6 +1094,7 @@ ...@@ -1091,6 +1094,7 @@
04344214225F0EDD003F7EC1 /* View */ = { 04344214225F0EDD003F7EC1 /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
C4F90D542864560B008A1E38 /* Sigin */,
04E789DC2696E37C00A1C6D4 /* Answer */, 04E789DC2696E37C00A1C6D4 /* Answer */,
04CB7E5E24AD7E8800EF6BCF /* Barrage */, 04CB7E5E24AD7E8800EF6BCF /* Barrage */,
04357C6522699371002081C0 /* Main */, 04357C6522699371002081C0 /* Main */,
...@@ -1920,6 +1924,15 @@ ...@@ -1920,6 +1924,15 @@
name = "Supporting Files"; name = "Supporting Files";
sourceTree = "<group>"; sourceTree = "<group>";
}; };
C4F90D542864560B008A1E38 /* Sigin */ = {
isa = PBXGroup;
children = (
C4F90D552864560B008A1E38 /* HDSSiginVIew.m */,
C4F90D562864560B008A1E38 /* HDSSiginVIew.h */,
);
path = Sigin;
sourceTree = "<group>";
};
DD383810264E5839006A48EE /* SDK */ = { DD383810264E5839006A48EE /* SDK */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -2417,6 +2430,7 @@ ...@@ -2417,6 +2430,7 @@
04344394225F1F07003F7EC1 /* UIView+WebCache.m in Sources */, 04344394225F1F07003F7EC1 /* UIView+WebCache.m in Sources */,
049FF09A225EEEA700D944C5 /* NSObject+MJClass.m in Sources */, 049FF09A225EEEA700D944C5 /* NSObject+MJClass.m in Sources */,
04344372225F1F07003F7EC1 /* SDImageAPNGCoder.m in Sources */, 04344372225F1F07003F7EC1 /* SDImageAPNGCoder.m in Sources */,
C4F90D572864560B008A1E38 /* HDSSiginVIew.m in Sources */,
043D4E6022D5BA3000FCDCBE /* DWScreeningBgView.m in Sources */, 043D4E6022D5BA3000FCDCBE /* DWScreeningBgView.m in Sources */,
04344370225F1F07003F7EC1 /* SDMemoryCache.m in Sources */, 04344370225F1F07003F7EC1 /* SDMemoryCache.m in Sources */,
04CB7E7024AD7E8800EF6BCF /* DWBarrageTextCell.m in Sources */, 04CB7E7024AD7E8800EF6BCF /* DWBarrageTextCell.m in Sources */,
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
return; return;
} }
} }
self.downloadModel.randomSign = @{@"seconds":@[@7, @18], @"title":@"本地视频签到", @"content":@"触手可及斯柯达几十块的境况数据库的数据库但实际上肯德基看似简单11111双卡双待就开始江苏科技SDK手机看的点点滴滴多多", @"btnText":@"点击签到"};;
[self.playerView playLocalVideo:self.downloadModel]; [self.playerView playLocalVideo:self.downloadModel];
/* /*
......
...@@ -14,7 +14,7 @@ ...@@ -14,7 +14,7 @@
#import "DWNetworkMonitorViewController.h" #import "DWNetworkMonitorViewController.h"
#import "DWScreeningListViewController.h" #import "DWScreeningListViewController.h"
#import "DWScreeningBgView.h" #import "DWScreeningBgView.h"
#import "MJExtension.h"
typedef enum : NSUInteger { typedef enum : NSUInteger {
DWVodPlayTableViewCellStyleDefault, DWVodPlayTableViewCellStyleDefault,
DWVodPlayTableViewCellStyleChoose, DWVodPlayTableViewCellStyleChoose,
...@@ -35,7 +35,8 @@ typedef enum : NSUInteger { ...@@ -35,7 +35,8 @@ typedef enum : NSUInteger {
@property(nonatomic,assign)BOOL isLock; @property(nonatomic,assign)BOOL isLock;
//@property (nonatomic, strong) DWPlayInfo * playInfo; @property (nonatomic, strong) DWPlayInfo * playInfo;
@property (nonatomic, strong) NSDictionary *signDict;
@end @end
...@@ -57,7 +58,7 @@ typedef enum : NSUInteger { ...@@ -57,7 +58,7 @@ typedef enum : NSUInteger {
return; return;
} }
} }
self.signDict = @{@"seconds":@[@100,@60, @60, @120, @180], @"title":@"测试随机签到", @"content":@"是的是的多多多多多多多吃is好滴好滴啊还是肯定会教案设计安徽师大可结案回调数据客户的家看回撒娇坎大哈数据库的好时机斯卡哈数据库回到家说不定就啊不是看都不看萨哈比", @"btnText":@"点击签到三生三世"};
DWConfigurationManager * manager = [DWConfigurationManager sharedInstance]; DWConfigurationManager * manager = [DWConfigurationManager sharedInstance];
manager.isOpenAd = YES; manager.isOpenAd = YES;
if (manager.isOpenAd) { if (manager.isOpenAd) {
...@@ -76,24 +77,26 @@ typedef enum : NSUInteger { ...@@ -76,24 +77,26 @@ typedef enum : NSUInteger {
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
DWPlayInfo * playInfo = [[DWPlayInfo alloc]initWithUserId:[DWConfigurationManager sharedInstance].DWAccount_userId andVideoId:videoId key:[DWConfigurationManager sharedInstance].DWAccount_apikey hlsSupport:@"1"]; DWPlayInfo * playInfo = [[DWPlayInfo alloc]initWithUserId:[DWConfigurationManager sharedInstance].DWAccount_userId andVideoId:videoId key:[DWConfigurationManager sharedInstance].DWAccount_apikey hlsSupport:@"1"];
playInfo.timeoutSeconds = 30; _playInfo = playInfo;
_playInfo.timeoutSeconds = 30;
//音频 + 视频数据,这里仅做示范,可根据自己项目业务逻辑来调整 //音频 + 视频数据,这里仅做示范,可根据自己项目业务逻辑来调整
//开启授权验证功能传入 //开启授权验证功能传入
playInfo.verificationCode = [DWConfigurationManager sharedInstance].verification; _playInfo.verificationCode = [DWConfigurationManager sharedInstance].verification;
//客户端用户id,选填 //客户端用户id,选填
// playInfo.roleId = @""; // playInfo.roleId = @"";
playInfo.mediatype = @"0"; _playInfo.mediatype = @"0";
playInfo.isAllow = NO;//yes:拖拽不显示答题器 _playInfo.isAllow = NO;//yes:拖拽不显示答题器
playInfo.finishBlock = ^(DWVodVideoModel *vodVideo) { _playInfo.finishBlock = ^(DWVodVideoModel *vodVideo) {
NSLog(@"%@",vodVideo); NSLog(@"%@",vodVideo);
//下载时,保存图片,名字等数据 //下载时,保存图片,名字等数据
weakSelf.playerView.vodModel = weakSelf.vodModel; weakSelf.playerView.vodModel = weakSelf.vodModel;
vodVideo.randomSign = weakSelf.signDict;
[weakSelf.playerView setVodVideo:vodVideo]; [weakSelf.playerView setVodVideo:vodVideo];
}; };
playInfo.errorBlock = ^(NSError *error) { _playInfo.errorBlock = ^(NSError *error) {
[error.localizedDescription showAlert]; [error.localizedDescription showAlert];
}; };
[playInfo start]; [_playInfo start];
} }
//1片头广告,2暂停广告,3片尾广告 //1片头广告,2暂停广告,3片尾广告
...@@ -471,6 +474,7 @@ typedef enum : NSUInteger { ...@@ -471,6 +474,7 @@ typedef enum : NSUInteger {
[self.playerView saveSliderSchedule]; [self.playerView saveSliderSchedule];
self.vodModel = vodModel; self.vodModel = vodModel;
self.signDict = @{@"seconds":@[@10, @40, @80], @"title":@"切换-->测试随机签到", @"content":@"是的是的多多多多多多多吃is好滴好滴啊还是肯定会教案设计安徽师大可结案回调数据客户的家看回撒娇坎大哈数据库的好时机斯卡哈数据库回到家说不定就啊不是看都不看萨哈比", @"btnText":@"点击签到"};
DWConfigurationManager * manager = [DWConfigurationManager sharedInstance]; DWConfigurationManager * manager = [DWConfigurationManager sharedInstance];
if (manager.isOpenAd) { if (manager.isOpenAd) {
//广告模式 //广告模式
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#import "DWAnswerModel.h" #import "DWAnswerModel.h"
#import "MJExtension.h" #import "MJExtension.h"
#import "DWPlayerKnowledgeView.h" #import "DWPlayerKnowledgeView.h"
#import "HDSSiginVIew.h"
@interface DWVodPlayerView ()<DWVideoPlayerDelegate,DWPlayerSettingViewDelegate,DWGifRecordFinishViewDelegate,DWVisitorCollectViewDelegate,DWExercisesAlertViewDelegate,DWExercisesViewDelegate,AVPictureInPictureControllerDelegate,DWVodPlayerPanGestureDelegate,DWBarrageManagerDelegate,DWBarrageBgViewDelegate> @interface DWVodPlayerView ()<DWVideoPlayerDelegate,DWPlayerSettingViewDelegate,DWGifRecordFinishViewDelegate,DWVisitorCollectViewDelegate,DWExercisesAlertViewDelegate,DWExercisesViewDelegate,AVPictureInPictureControllerDelegate,DWVodPlayerPanGestureDelegate,DWBarrageManagerDelegate,DWBarrageBgViewDelegate>
@property(nonatomic,strong)UIView * maskView;//遮罩层 @property(nonatomic,strong)UIView * maskView;//遮罩层
...@@ -248,6 +249,11 @@ ...@@ -248,6 +249,11 @@
@property (nonatomic, strong) NSIndexPath *indexPath; @property (nonatomic, strong) NSIndexPath *indexPath;
@property (nonatomic, strong)DWPlayerKnowledgeView *knowledgeView; @property (nonatomic, strong)DWPlayerKnowledgeView *knowledgeView;
//****************************随机签到功能******************
@property (nonatomic, strong) HDSSiginVIew *signView;
@property (nonatomic, strong) NSMutableArray *signArr;//签到记录
@property (nonatomic, assign) int currentIndex;//记录角标
@end @end
@implementation DWVodPlayerView @implementation DWVodPlayerView
...@@ -314,7 +320,8 @@ static CGFloat barrageBgHeight = 40; ...@@ -314,7 +320,8 @@ static CGFloat barrageBgHeight = 40;
self.isShowAd = NO; self.isShowAd = NO;
self.allowImpact = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allowImpact"] boolValue]; self.allowImpact = [[[NSUserDefaults standardUserDefaults] objectForKey:@"allowImpact"] boolValue];
self.signArr = [NSMutableArray array];
self.currentIndex = 0;
self.backgroundColor = [UIColor blackColor]; self.backgroundColor = [UIColor blackColor];
[self initMaskView]; [self initMaskView];
...@@ -466,6 +473,22 @@ static CGFloat barrageBgHeight = 40; ...@@ -466,6 +473,22 @@ static CGFloat barrageBgHeight = 40;
[_answerView removeFromSuperview]; [_answerView removeFromSuperview];
_answerView = nil; _answerView = nil;
} }
if(_signView){
[_signView removeFromSuperview];
_signView = nil;
}
NSArray *sortArray = [self.videoModel.randomSign[@"seconds"] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
if ([obj1 floatValue] > [obj2 floatValue]) {
return NSOrderedDescending;//降序
}else if ([obj1 floatValue] > [obj2 floatValue]){
return NSOrderedAscending;//升序
}else {
return NSOrderedSame;//相等
}
}];
[self.signArr removeAllObjects];
[self.signArr addObjectsFromArray:sortArray];
self.currentIndex = 0;
[self.answerArr removeAllObjects]; [self.answerArr removeAllObjects];
//当数组中包含video_clicker的时候才会请求答题器和知识点接口 //当数组中包含video_clicker的时候才会请求答题器和知识点接口
if([self.videoModel.reskeys containsObject:@"video_clicker"] || [self.videoModel.reskeys containsObject:@"video_knowledge"]){ if([self.videoModel.reskeys containsObject:@"video_clicker"] || [self.videoModel.reskeys containsObject:@"video_knowledge"]){
...@@ -509,8 +532,13 @@ static CGFloat barrageBgHeight = 40; ...@@ -509,8 +532,13 @@ static CGFloat barrageBgHeight = 40;
self.knowledgeBtn.hidden = YES; self.knowledgeBtn.hidden = YES;
} }
}else{ }else{
self.knowledgeBtn.hidden = NO; if(self.isFull){
[self.knowledgeBtn setTitle:self.knowledgeLocalDict[@"name"] forState:0]; self.knowledgeBtn.hidden = NO;
[self.knowledgeBtn setTitle:self.knowledgeLocalDict[@"name"] forState:0];
}else{
self.knowledgeBtn.hidden = YES;
[self.knowledgeBtn setTitle:self.knowledgeLocalDict[@"name"] forState:0];
}
} }
} }
}]; }];
...@@ -520,8 +548,24 @@ static CGFloat barrageBgHeight = 40; ...@@ -520,8 +548,24 @@ static CGFloat barrageBgHeight = 40;
-(void)playLocalVideo:(DWDownloadModel *)downloadModel -(void)playLocalVideo:(DWDownloadModel *)downloadModel
{ {
self.videoModel = nil; self.videoModel = nil;
if(_signView){
[_signView removeFromSuperview];
_signView = nil;
}
self.currentIndex = 0;
self.downloadModel = downloadModel; self.downloadModel = downloadModel;
NSArray *sortArray = [self.downloadModel.randomSign[@"seconds"] sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2) {
if ([obj1 floatValue] > [obj2 floatValue]) {
return NSOrderedDescending;//降序
}else if ([obj1 floatValue] > [obj2 floatValue]){
return NSOrderedAscending;//升序
}else {
return NSOrderedSame;//相等
}
}];
[self.signArr removeAllObjects];
[self.signArr addObjectsFromArray:sortArray];
self.enable = YES; self.enable = YES;
self.readyToPlay = NO; self.readyToPlay = NO;
...@@ -729,6 +773,8 @@ static CGFloat barrageBgHeight = 40; ...@@ -729,6 +773,8 @@ static CGFloat barrageBgHeight = 40;
//切换视频,保存已看进度 //切换视频,保存已看进度
-(void)saveSliderSchedule -(void)saveSliderSchedule
{ {
[self.signView removeFromSuperview];
self.signView = nil;
[self writeSliderWithVideoID:self.vodModel.videoId]; [self writeSliderWithVideoID:self.vodModel.videoId];
} }
...@@ -1549,7 +1595,7 @@ static CGFloat barrageBgHeight = 40; ...@@ -1549,7 +1595,7 @@ static CGFloat barrageBgHeight = 40;
weakSelf.exercisesLastScrubTime = -1; weakSelf.exercisesLastScrubTime = -1;
} }
if (_questionView || weakSelf.visitorCollectView || weakSelf.exercisesAlertView || weakSelf.exercisesView || _answerView) { if (_questionView || weakSelf.visitorCollectView || weakSelf.exercisesAlertView || weakSelf.exercisesView || _answerView || _signView) {
return; return;
} }
...@@ -2884,6 +2930,39 @@ static CGFloat barrageBgHeight = 40; ...@@ -2884,6 +2930,39 @@ static CGFloat barrageBgHeight = 40;
} }
} }
- (void)showSignView:(CGFloat)time{
NSDictionary *dict = self.videoModel.randomSign;
NSArray *arr = dict[@"seconds"];
if(!dict){
dict = self.downloadModel.randomSign;
arr = dict[@"seconds"];
}
if(_signView){
return;
}
for (NSNumber *second in self.signArr) {
if ([second intValue] <= (NSInteger)time) {
self.currentIndex ++;
[self.signArr removeObjectAtIndex:0];
[self sendWindowsFuncNotification:NO];
[self destroyFuncTimer];
[self pause];//暂停
if(_signView || _answerView || self.exercisesAlertView || self.exercisesView || _questionView || _visitorCollectView){
return;
}
_signView = [HDSSiginVIew new];
[_signView showSiginViewWithParam:dict index:self.currentIndex];
@weakify(self);
self.signView.signBLock = ^{//继续播放
@strongify(self);
[self resumeVideoPlay];
self.signView = nil;
};
break;
}
}
}
- (void)resumeVideoPlay - (void)resumeVideoPlay
{ {
[self play];//播放 [self play];//播放
...@@ -4021,8 +4100,6 @@ static CGFloat barrageBgHeight = 40; ...@@ -4021,8 +4100,6 @@ static CGFloat barrageBgHeight = 40;
[self.subtitleView setSubtitleWithTime:time]; [self.subtitleView setSubtitleWithTime:time];
} }
//答题器功能
// [self showAswerView:time];
//问答功能 //问答功能
[self showQuestionsView:time]; [self showQuestionsView:time];
...@@ -4036,7 +4113,7 @@ static CGFloat barrageBgHeight = 40; ...@@ -4036,7 +4113,7 @@ static CGFloat barrageBgHeight = 40;
[self showImpactView:time]; [self showImpactView:time];
[self showAswerView:time]; [self showAswerView:time];
[self showSignView:time];//随机签到
self.exercisesLastScrubTime = time; self.exercisesLastScrubTime = time;
//拖拽时,禁止刷新进度信息 //拖拽时,禁止刷新进度信息
...@@ -4114,7 +4191,7 @@ static CGFloat barrageBgHeight = 40; ...@@ -4114,7 +4191,7 @@ static CGFloat barrageBgHeight = 40;
return; return;
} }
if (_questionView || self.visitorCollectView || self.exercisesAlertView || self.exercisesView || _answerView) { if (_questionView || self.visitorCollectView || self.exercisesAlertView || self.exercisesView || _answerView || _signView) {
return; return;
} }
...@@ -4972,7 +5049,7 @@ static CGFloat barrageBgHeight = 40; ...@@ -4972,7 +5049,7 @@ static CGFloat barrageBgHeight = 40;
{ {
if (!_speedArray) { if (!_speedArray) {
_speedArray = [[NSMutableArray alloc]init]; _speedArray = [[NSMutableArray alloc]init];
NSArray * titles = @[@"0.5X",@"1.0X",@"1.5X",@"2.0X"]; NSArray * titles = @[@"0.5X",@"1.0X",@"1.5X",@"2.0X",@"2.5X"];
[titles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) { [titles enumerateObjectsUsingBlock:^(id _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
DWTableChooseModel * chooseModel = [[DWTableChooseModel alloc]init]; DWTableChooseModel * chooseModel = [[DWTableChooseModel alloc]init];
chooseModel.title = (NSString *)obj; chooseModel.title = (NSString *)obj;
......
//
// HDSSiginVIew.h
// Demo
//
// Created by gw on 2022/6/15.
// Copyright © 2022 com.bokecc.www. All rights reserved.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
typedef void(^HDSSignBlock)(void);
@interface HDSSiginVIew : UIView
- (void)showSiginViewWithParam:(NSDictionary *)signDict index:(int)index;
@property (nonatomic, copy) HDSSignBlock signBLock;
@end
NS_ASSUME_NONNULL_END
//
// HDSSiginVIew.m
// Demo
//
// Created by gw on 2022/6/15.
// Copyright © 2022 com.bokecc.www. All rights reserved.
//
#import "HDSSiginVIew.h"
#define ScreenW [UIScreen mainScreen].bounds.size.width
#define ScreenH [UIScreen mainScreen].bounds.size.height
#define iPhoneX (((int)((ScreenH/ScreenW)*100) == 216)?YES:NO)
@interface HDSSiginVIew ()
@property (nonatomic, strong) UIImageView *topImage;
@property (nonatomic, strong) UIView *whiteCenterView;
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UILabel *contentView;
@property (nonatomic, strong) UIButton *signinBtn;
@property (nonatomic, assign) BOOL isLandscape;//是否是横屏
@property (nonatomic, assign) CGFloat DWHeight;//播放器高度
@property (nonatomic, strong) UIButton *markBtn;
@property (nonatomic, copy) NSString *contentStr;
@end
@implementation HDSSiginVIew
- (instancetype)initWithFrame:(CGRect)frame{
if(self == [super initWithFrame:frame]){
self.backgroundColor = ColorFrom16A(0x000000, 0.5);
CGSize viewSize = CGSizeZero;
if (@available(iOS 11.0, *)) {
CGFloat a = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom;
if (a > 0) {
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0) + 64);
}else{
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0));
}
} else {
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0));
}
_DWHeight = viewSize.height;
// 判断横屏
if ([UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeRight ||
[UIApplication sharedApplication].statusBarOrientation == UIDeviceOrientationLandscapeLeft) {
//当前横屏
_isLandscape = YES;
} else {
//当前竖屏
_isLandscape = NO;
}
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(deviceOrientationChangeNotification) name:UIDeviceOrientationDidChangeNotification object:nil];
if(_isLandscape){
self.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
}else{
self.frame = CGRectMake(0, 0, ScreenWidth, _DWHeight);
}
[[UIApplication sharedApplication].keyWindow addSubview:self];
}
return self;
}
-(void)deviceOrientationChangeNotification
{
CGSize viewSize = CGSizeZero;
if (@available(iOS 11.0, *)) {
CGFloat a = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom;
if (a > 0) {
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0) + 64);
}else{
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0));
}
} else {
viewSize = CGSizeMake(ScreenWidth, ScaleHeight(ScreenWidth, 375 / 211.0));
}
_DWHeight = viewSize.height;
UIDeviceOrientation orientation = [UIDevice currentDevice].orientation;
UIInterfaceOrientation interfaceOrientation = (UIInterfaceOrientation)orientation;
switch (interfaceOrientation) {
case UIInterfaceOrientationPortrait:{
// NSLog(@"================ 竖屏");
_isLandscape = NO;
[self updateLayout];
break;
}
case UIInterfaceOrientationLandscapeLeft:{
// NSLog(@"++++++ 横屏");
_isLandscape = YES;
[self updateLayout];
break;
}
case UIInterfaceOrientationLandscapeRight:{
// NSLog(@"----------- 横屏");
_isLandscape = YES;
[self updateLayout];
break;
}
default:
break;
}
}
- (void)showSiginViewWithParam:(NSDictionary *)signDict index:(int)index{
[self setupViewWithParam:signDict index:index];
}
- (void)setupViewWithParam:(NSDictionary *)dict index:(int)index{
_whiteCenterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 375, 100)];
_whiteCenterView.layer.cornerRadius = 5;
_whiteCenterView.layer.backgroundColor = UIColor.whiteColor.CGColor;
_whiteCenterView.center = self.center;
[self addSubview:_whiteCenterView];
_markBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_markBtn setImage:[UIImage imageNamed:@"sign_bgView_icon"] forState:0];