Commit e78ce649 by 路少雄

进度条

parent 10dde3a5
......@@ -10,9 +10,10 @@
#import <KTVHTTPCache/KTVHTTPCache.h>
#import <Photos/Photos.h>
#import "DXHFXVideoCell.h"
#import "DXProgressBarView.h"
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";
@property (nonatomic,strong) UIButton *noChangeBtn;
@property (nonatomic ,strong)DXProgressBarView *progressBarView;
@end
......@@ -66,6 +69,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
return self;
}
- (void)setCurrentStress:(NSString *)currentStress{
_currentStress = currentStress;
self.stressLb.text = currentStress;
......@@ -287,6 +291,16 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
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"]){
// NSString *videoVolumeIsOn = [HJUserDefaults objectForKey:@"videoVolumeIsOn"];
// if([videoVolumeIsOn isEqualToString:@"1"]){
......@@ -575,36 +589,39 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
}];
}
- (void)setTimeLineWithString:(NSString *)describeInfo{
// self.timesBtnArray = [NSMutableArray array];
//
// NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","];
// NSMutableArray *titleArray = [NSMutableArray array];
// NSMutableArray *titleTimeArray = [NSMutableArray array];
// NSMutableArray *timeArray = [NSMutableArray array];
// for (int i = 0; i < itemTitleArray.count; i ++) {
// NSArray *temparray = [itemTitleArray[i] componentsSeparatedByString:@":"];
// [titleArray addObject:temparray[0]];
// [titleTimeArray addObject:temparray[1]];
// [timeArray addObject:temparray[2]];
// }
// NSMutableArray *titleTimeArray1 = [NSMutableArray array];
// for (__strong NSString *titleTime in titleTimeArray) {
// if([titleTime intValue] < 60){
// if (!titleTime || [titleTime isEqualToString:@""]) {
// titleTime = @"";
//// titleTime = [NSString stringWithFormat:@"%@s",titleTime];
// }else{
self.timesBtnArray = [NSMutableArray array];
NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","];
NSMutableArray *titleArray = [NSMutableArray array];
NSMutableArray *titleTimeArray = [NSMutableArray array];
NSMutableArray *timeArray = [NSMutableArray array];
for (int i = 0; i < itemTitleArray.count; i ++) {
NSArray *temparray = [itemTitleArray[i] componentsSeparatedByString:@":"];
[titleArray addObject:temparray[0]];
[titleTimeArray addObject:temparray[1]];
[timeArray addObject:temparray[2]];
}
NSMutableArray *titleTimeArray1 = [NSMutableArray array];
for (__strong NSString *titleTime in titleTimeArray) {
if([titleTime intValue] < 60){
if (!titleTime || [titleTime isEqualToString:@""]) {
titleTime = @"";
// titleTime = [NSString stringWithFormat:@"%@s",titleTime];
// }
//
// }else if([titleTime intValue] % 60 == 0){
// titleTime = [NSString stringWithFormat:@"%dmin",[titleTime intValue] / 60];
// }else{
// titleTime = [NSString stringWithFormat:@"%dmins %ds",[titleTime intValue] / 60,[titleTime intValue] % 60];
// }
// [titleTimeArray1 addObject:titleTime];
// }
//
}else{
titleTime = [NSString stringWithFormat:@"%@s",titleTime];
}
}else if([titleTime intValue] % 60 == 0){
titleTime = [NSString stringWithFormat:@"%dmin",[titleTime intValue] / 60];
}else{
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){
// _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