Commit e41afef7 by 李威

视频监听修改

parent cf5de308
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
@interface DXHFXView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate,DXProgressBarViewDelegate> @interface DXHFXView ()<UICollectionViewDelegate,UICollectionViewDataSource,UICollectionViewDelegateFlowLayout,UIGestureRecognizerDelegate,DXProgressBarViewDelegate>
...@@ -53,6 +53,9 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -53,6 +53,9 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
@property (nonatomic ,strong)DXProgressBarView *progressBarView; @property (nonatomic ,strong)DXProgressBarView *progressBarView;
@property (nonatomic,strong) NSMutableArray *timeArray;
@end @end
...@@ -275,7 +278,15 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -275,7 +278,15 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
self.playerView.playerDidToEnd = ^(id _Nonnull asset) { self.playerView.playerDidToEnd = ^(id _Nonnull asset) {
weakSelf.playerView.assetURL = proxyURL; weakSelf.playerView.assetURL = proxyURL;
}; };
self.playerView.playerPlayTimeChanged = ^(id<ZFPlayerMediaPlayback> _Nonnull asset, NSTimeInterval currentTime, NSTimeInterval duration) {
if (!weakSelf.progressBarView.timeArray) {
[weakSelf.progressBarView progressBarTimeArray:weakSelf.timeArray Totaltime:duration];
NSLog(@"当前播放时间=%f",currentTime);
}
weakSelf.progressBarView.playTime = currentTime;
};
_volumeBtn = [UIButton buttonWithType:UIButtonTypeCustom]; _volumeBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[_volumeBtn setImage:[UIImage imageNamed:@"HFX_novolume"] forState:UIControlStateNormal]; [_volumeBtn setImage:[UIImage imageNamed:@"HFX_novolume"] forState:UIControlStateNormal];
...@@ -619,15 +630,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell"; ...@@ -619,15 +630,7 @@ static NSString *dXHFXVideoCell = @"DXHFXVideoCell";
[titleTimeArray1 addObject:titleTime]; [titleTimeArray1 addObject:titleTime];
} }
self.progressBarView.timeArray = nil; self.progressBarView.timeArray = nil;
HJSelfWeak; self.timeArray = timeArray;
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;
};
return timeArray; return timeArray;
// //
......
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