Commit e78ce649 by 路少雄

进度条

parent 10dde3a5
...@@ -10,9 +10,10 @@ ...@@ -10,9 +10,10 @@
#import <KTVHTTPCache/KTVHTTPCache.h> #import <KTVHTTPCache/KTVHTTPCache.h>
#import <Photos/Photos.h> #import <Photos/Photos.h>
#import "DXHFXVideoCell.h" #import "DXHFXVideoCell.h"
#import "DXProgressBarView.h"
static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
@interface DXHFXView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate> @interface DXHFXView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate,DXProgressBarViewDelegate>
...@@ -50,6 +51,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -50,6 +51,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
@property (nonatomic,strong) UIButton *noChangeBtn; @property (nonatomic,strong) UIButton *noChangeBtn;
@property (nonatomic ,strong)DXProgressBarView *progressBarView;
@end @end
...@@ -66,6 +69,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -66,6 +69,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
return self; return self;
} }
- (void)setCurrentStress:(NSString *)currentStress{ - (void)setCurrentStress:(NSString *)currentStress{
_currentStress = currentStress; _currentStress = currentStress;
self.stressLb.text = currentStress; self.stressLb.text = currentStress;
...@@ -287,6 +291,16 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -287,6 +291,16 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
make.size.mas_equalTo(CGSizeMake(32, 32)); make.size.mas_equalTo(CGSizeMake(32, 32));
}]; }];
[self layoutIfNeeded];
self.progressBarView = [[DXProgressBarView alloc] initWithFrame:CGRectMake(0, self.containerView.bottom + 5, HJScreenWidth - 38, 30)];
self.progressBarView.delegate = self;
[self addSubview:self.progressBarView];
// if([HJUserDefaults objectForKey:@"videoVolumeIsOn"]){ // if([HJUserDefaults objectForKey:@"videoVolumeIsOn"]){
// NSString *videoVolumeIsOn = [HJUserDefaults objectForKey:@"videoVolumeIsOn"]; // NSString *videoVolumeIsOn = [HJUserDefaults objectForKey:@"videoVolumeIsOn"];
// if([videoVolumeIsOn isEqualToString:@"1"]){ // if([videoVolumeIsOn isEqualToString:@"1"]){
...@@ -575,36 +589,39 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -575,36 +589,39 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
}]; }];
} }
- (void)setTimeLineWithString:(NSString *)describeInfo{ - (void)setTimeLineWithString:(NSString *)describeInfo{
// self.timesBtnArray = [NSMutableArray array]; self.timesBtnArray = [NSMutableArray array];
//
// NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","]; NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","];
// NSMutableArray *titleArray = [NSMutableArray array]; NSMutableArray *titleArray = [NSMutableArray array];
// NSMutableArray *titleTimeArray = [NSMutableArray array]; NSMutableArray *titleTimeArray = [NSMutableArray array];
// NSMutableArray *timeArray = [NSMutableArray array]; NSMutableArray *timeArray = [NSMutableArray array];
// for (int i = 0; i < itemTitleArray.count; i ++) { for (int i = 0; i < itemTitleArray.count; i ++) {
// NSArray *temparray = [itemTitleArray[i] componentsSeparatedByString:@":"]; NSArray *temparray = [itemTitleArray[i] componentsSeparatedByString:@":"];
// [titleArray addObject:temparray[0]]; [titleArray addObject:temparray[0]];
// [titleTimeArray addObject:temparray[1]]; [titleTimeArray addObject:temparray[1]];
// [timeArray addObject:temparray[2]]; [timeArray addObject:temparray[2]];
// } }
// NSMutableArray *titleTimeArray1 = [NSMutableArray array]; NSMutableArray *titleTimeArray1 = [NSMutableArray array];
// for (__strong NSString *titleTime in titleTimeArray) { for (__strong NSString *titleTime in titleTimeArray) {
// if([titleTime intValue] < 60){ if([titleTime intValue] < 60){
// if (!titleTime || [titleTime isEqualToString:@""]) { if (!titleTime || [titleTime isEqualToString:@""]) {
// titleTime = @""; titleTime = @"";
//// titleTime = [NSString stringWithFormat:@"%@s",titleTime];
// }else{
// titleTime = [NSString stringWithFormat:@"%@s",titleTime]; // titleTime = [NSString stringWithFormat:@"%@s",titleTime];
// } }else{
// titleTime = [NSString stringWithFormat:@"%@s",titleTime];
// }else if([titleTime intValue] % 60 == 0){ }
// titleTime = [NSString stringWithFormat:@"%dmin",[titleTime intValue] / 60];
// }else{ }else if([titleTime intValue] % 60 == 0){
// titleTime = [NSString stringWithFormat:@"%dmins %ds",[titleTime intValue] / 60,[titleTime intValue] % 60]; titleTime = [NSString stringWithFormat:@"%dmin",[titleTime intValue] / 60];
// } }else{
// [titleTimeArray1 addObject:titleTime]; titleTime = [NSString stringWithFormat:@"%dmins %ds",[titleTime intValue] / 60,[titleTime intValue] % 60];
// } }
// [titleTimeArray1 addObject:titleTime];
}
NSInteger vvv = self.playerView.totalTime;
[self.progressBarView progressBarTimeArray:timeArray Totaltime:vvv];
//
// if(itemTitleArray.count > 1){ // if(itemTitleArray.count > 1){
// _timeScrollView = [[UIScrollView alloc] init]; // _timeScrollView = [[UIScrollView alloc] init];
// //
......
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