Commit d2a9569c by 李威

进度条修改

parent e78ce649
...@@ -588,7 +588,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -588,7 +588,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
weakSelf.popBgView.hidden = YES; weakSelf.popBgView.hidden = YES;
}]; }];
} }
- (void)setTimeLineWithString:(NSString *)describeInfo{ - (NSMutableArray *)setTimeLineWithString:(NSString *)describeInfo{
self.timesBtnArray = [NSMutableArray array]; self.timesBtnArray = [NSMutableArray array];
NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","]; NSArray *itemTitleArray = [describeInfo componentsSeparatedByString:@","];
...@@ -619,8 +619,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -619,8 +619,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
[titleTimeArray1 addObject:titleTime]; [titleTimeArray1 addObject:titleTime];
} }
NSInteger vvv = self.playerView.totalTime; NSInteger vvv = self.playerView.totalTime;
return timeArray;
[self.progressBarView progressBarTimeArray:timeArray Totaltime:vvv];
// //
// if(itemTitleArray.count > 1){ // if(itemTitleArray.count > 1){
// _timeScrollView = [[UIScrollView alloc] init]; // _timeScrollView = [[UIScrollView alloc] init];
...@@ -719,6 +719,14 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -719,6 +719,14 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
// //
} }
-(void)playVideoTime:(CGFloat)time {
[self.playerView seekToTime:time completionHandler:^(BOOL finished) {
}];
}
- (void)changeViewPlayTime:(UIButton *)sender{ - (void)changeViewPlayTime:(UIButton *)sender{
// NSArray *stringUrlOne = [sender.titleLabel.text componentsSeparatedByString:@"s"]; // NSArray *stringUrlOne = [sender.titleLabel.text componentsSeparatedByString:@"s"];
...@@ -764,7 +772,17 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -764,7 +772,17 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
_allfaceBtn.hidden = YES; _allfaceBtn.hidden = YES;
[_allfaceBtn setTitle:_currentVideoList[0].detail forState:UIControlStateNormal]; [_allfaceBtn setTitle:_currentVideoList[0].detail forState:UIControlStateNormal];
} }
[self setTimeLineWithString:_currentVideoList[0].describeInfo]; NSMutableArray *timeArray = [self setTimeLineWithString:_currentVideoList[0].describeInfo];
self.playerView.playerPlayTimeChanged = ^(id<ZFPlayerMediaPlayback> _Nonnull asset, NSTimeInterval currentTime, NSTimeInterval duration) {
if (!weakSelf.progressBarView.timeArray) {
[weakSelf.progressBarView progressBarTimeArray:timeArray Totaltime:duration];
NSLog(@"当前播放时间=%f",currentTime);
}
weakSelf.progressBarView.playTime = currentTime;
};
[_collectionView reloadData]; [_collectionView reloadData];
} }
...@@ -883,6 +901,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -883,6 +901,8 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
weakSelf.playerView.assetURL = proxyURL; weakSelf.playerView.assetURL = proxyURL;
}; };
} }
- (void)setCurrentVideoList:(NSMutableArray<DXHFXVideoDetailsModel *> *)currentVideoList{ - (void)setCurrentVideoList:(NSMutableArray<DXHFXVideoDetailsModel *> *)currentVideoList{
......
...@@ -19,9 +19,20 @@ ...@@ -19,9 +19,20 @@
-(void)progressBarTimeArray:(NSArray *)array Totaltime:(CGFloat)time{ -(void)progressBarTimeArray:(NSArray *)array Totaltime:(CGFloat)time{
[self.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];
NSMutableArray *timeArray = [NSMutableArray arrayWithCapacity:0];
for (int i = 0; i<array.count; i++) {
if (i == array.count-1) {
[timeArray addObject:[NSNumber numberWithFloat:(time- [array[i] floatValue])]];
}else {
[timeArray addObject:array[i+1]];
}
}
self.totaltime = time; self.totaltime = time;
self.timeArray = array; self.timeArray = timeArray;
UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(18.5, 10, HJScreenWidth-18.5*2, 6.5)]; UIView *backView = [[UIView alloc] initWithFrame:CGRectMake(18.5, 10, HJScreenWidth-18.5*2, 6.5)];
backView.backgroundColor = XHColorRGB_Alpha(175, 44, 35, 0.12); backView.backgroundColor = XHColorRGB_Alpha(175, 44, 35, 0.12);
backView.layer.cornerRadius = backView.height/2; backView.layer.cornerRadius = backView.height/2;
...@@ -34,8 +45,11 @@ ...@@ -34,8 +45,11 @@
CGFloat currentLength = 0; CGFloat currentLength = 0;
CGFloat node = 0; CGFloat node = 0;
for (int i = 0; i<array.count; i++) { for (int i = 0; i<timeArray.count; i++) {
CGFloat length = [[array objectAtIndex:i] floatValue];
CGFloat length = [[timeArray objectAtIndex:i] floatValue];
node = node+length; node = node+length;
CGFloat proportion = node/time; CGFloat proportion = node/time;
......
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