YBVideoControlView.m 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530
  1. //
  2. // YBVideoControlView.m
  3. // YBVideo
  4. //
  5. // Created by YB007 on 2019/11/7.
  6. // Copyright © 2019 cat. All rights reserved.
  7. //
  8. #import "YBVideoControlView.h"
  9. #import <ZFPlayer/UIView+ZFFrame.h>
  10. #import <ZFPlayer/UIImageView+ZFCache.h>
  11. #import <ZFPlayer/ZFUtilities.h>
  12. #import "ZFLoadingView.h"
  13. #import <ZFPlayer/ZFSliderView.h>
  14. #import "UIImage+RKCircleImg.h"
  15. #import "expensiveGiftV.h"
  16. #import "continueGift.h"
  17. #import "RKShowPaintedView.h"
  18. #import "YBHomeRedObj.h"
  19. @interface YBVideoControlView()<haohuadelegate,ZFSliderViewDelegate>
  20. {
  21. BOOL _muteChange;
  22. expensiveGiftV *haohualiwuV;//豪华礼物
  23. continueGift *continueGifts;//连送礼物
  24. UIView *liansongliwubottomview;
  25. }
  26. /// 封面图
  27. @property (nonatomic, strong) UIImageView *coverImageView;
  28. @property (nonatomic, strong) UIButton *playBtn;
  29. @property (nonatomic, strong) ZFSliderView *sliderView;
  30. @property (nonatomic, strong) UIImageView *bgImgView;
  31. @property (nonatomic, strong) UIView *effectView;
  32. @property(nonatomic,strong)RKShowPaintedView *paintedShowRegion; //手绘礼物显示区域
  33. @property(nonatomic,strong)UIButton *ttBackBtn;
  34. @property(nonatomic,strong)UILabel *timeLb;
  35. @end
  36. @implementation YBVideoControlView
  37. @synthesize player = _player;
  38. - (instancetype)init {
  39. self = [super init];
  40. if (self) {
  41. _muteChange = NO;
  42. [self addSubview:self.paintedShowRegion];
  43. liansongliwubottomview = [[UIView alloc]init];
  44. liansongliwubottomview.userInteractionEnabled = NO;
  45. liansongliwubottomview.backgroundColor = UIColor.clearColor;
  46. [self addSubview:liansongliwubottomview];
  47. liansongliwubottomview.frame = CGRectMake(0, statusbarHeight + 240,_window_width,140);
  48. [self addSubview:self.playBtn];
  49. [self addSubview:self.ttBackBtn];
  50. [_ttBackBtn mas_makeConstraints:^(MASConstraintMaker *make) {
  51. make.left.equalTo(self.mas_left).offset(statusbarHeight+10);
  52. make.top.equalTo(self.mas_top).offset(statusbarHeight+20);
  53. make.width.height.mas_equalTo(40);
  54. }];
  55. [self addSubview:self.sliderView];
  56. [self addSubview:self.timeLb];
  57. [self addSubview:self.zfVolumeView];
  58. [self resetControlView];
  59. [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(volumeChanged:) name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];
  60. }
  61. return self;
  62. }
  63. - (void)dealloc{
  64. [[NSNotificationCenter defaultCenter] removeObserver:self name:@"AVSystemController_SystemVolumeDidChangeNotification" object:nil];
  65. }
  66. /// 音量改变的通知
  67. - (void)volumeChanged:(NSNotification *)notification {
  68. if (_muteChange == YES) {
  69. _muteChange = NO;
  70. return;
  71. }
  72. NSDictionary *userInfo = notification.userInfo;
  73. NSString *reasonstr = userInfo[@"AVSystemController_AudioVolumeChangeReasonNotificationParameter"];
  74. if ([reasonstr isEqualToString:@"ExplicitVolumeChange"]) {
  75. float volume = [ userInfo[@"AVSystemController_AudioVolumeNotificationParameter"] floatValue];
  76. self.currentVol = volume;
  77. [self.zfVolumeView updateProgress:volume withVolumeBrightnessType:ZFVolumeBrightnessTypeVolume];
  78. }
  79. }
  80. - (void)layoutSubviews {
  81. [super layoutSubviews];
  82. self.coverImageView.frame = self.player.currentPlayerManager.view.bounds;
  83. CGFloat min_x = 0;
  84. CGFloat min_y = 0;
  85. CGFloat min_w = 0;
  86. CGFloat min_h = 0;
  87. CGFloat min_view_w = self.zf_width;
  88. CGFloat min_view_h = self.zf_height;
  89. min_w = 100;
  90. min_h = 100;
  91. self.playBtn.frame = CGRectMake(min_x, min_y, min_w, min_h);
  92. self.playBtn.center = self.center;
  93. min_x = 0;
  94. min_y = min_view_h - 50 - ShowDiff-25;//80
  95. min_w = min_view_w;
  96. min_h = 42;
  97. self.sliderView.frame = CGRectMake(min_x, min_y, min_w, min_h);
  98. self.bgImgView.frame = self.bounds;
  99. self.effectView.frame = self.bgImgView.bounds;
  100. self.zfVolumeView.frame = self.sliderView.frame;
  101. NSLog(@"===%@",self.zfVolumeView);
  102. self.timeLb.frame = CGRectMake(0, self.sliderView.top-20, self.width, 20);
  103. }
  104. - (void)resetControlView {
  105. self.playBtn.hidden = YES;
  106. self.sliderView.value = 0;
  107. self.sliderView.bufferValue = 0;
  108. self.coverImageView.contentMode = UIViewContentModeScaleAspectFit;
  109. //礼物视图重置
  110. if (continueGifts) {
  111. [continueGifts stopTimerAndArray];
  112. [continueGifts initGift];
  113. [continueGifts removeFromSuperview];
  114. continueGifts = nil;
  115. }
  116. if (haohualiwuV) {
  117. [haohualiwuV stopHaoHUaLiwu];
  118. [haohualiwuV removeFromSuperview];
  119. haohualiwuV.expensiveGiftCount = nil;
  120. haohualiwuV = nil;
  121. }
  122. liansongliwubottomview.top = statusbarHeight+240;
  123. if (_paintedShowRegion) {
  124. [_paintedShowRegion destroyPaitend];
  125. }
  126. }
  127. /// 加载状态改变
  128. - (void)videoPlayer:(ZFPlayerController *)videoPlayer loadStateChanged:(ZFPlayerLoadState)state {
  129. if (state == ZFPlayerLoadStatePrepare) {
  130. self.coverImageView.hidden = NO;
  131. } else if (state == ZFPlayerLoadStatePlaythroughOK || state == ZFPlayerLoadStatePlayable) {
  132. self.coverImageView.hidden = YES;
  133. self.effectView.hidden = NO;
  134. //缓冲的时候点击了暂停
  135. if (self.playBtn.hidden == NO) {
  136. [videoPlayer.currentPlayerManager pause];
  137. }
  138. // 青少年模式受限
  139. if ([YBYoungManager shareInstance].youngBan == 1) {
  140. self.playBtn.hidden = NO;
  141. [videoPlayer.currentPlayerManager pause];
  142. }
  143. }
  144. if ((state == ZFPlayerLoadStateStalled || state == ZFPlayerLoadStatePrepare) && videoPlayer.currentPlayerManager.isPlaying) {
  145. [self.sliderView startAnimating];
  146. } else {
  147. [self.sliderView stopAnimating];
  148. }
  149. }
  150. - (void)videoPlayer:(ZFPlayerController *)videoPlayer playStateChanged:(ZFPlayerPlaybackState)state {
  151. // NSLog(@"rk_===playState:%lu",(unsigned long)state);
  152. if (_isDisappear&&state==ZFPlayerPlayStatePlaying) {
  153. NSLog(@"rk_实行了");
  154. [self.player stopCurrentPlayingCell];
  155. }
  156. }
  157. /// 播放进度改变回调
  158. - (void)videoPlayer:(ZFPlayerController *)videoPlayer currentTime:(NSTimeInterval)currentTime totalTime:(NSTimeInterval)totalTime {
  159. // NSLog(@"xxxxxx:%f",videoPlayer.bufferProgress);
  160. if (videoPlayer.bufferProgress >= 0.9) {
  161. [self.sliderView stopAnimating];
  162. }
  163. self.sliderView.value = videoPlayer.progress;
  164. }
  165. - (void)gestureSingleTapped:(ZFPlayerGestureControl *)gestureControl {
  166. if (self.ybContorEvent) {
  167. self.ybContorEvent(@"控制-单击",gestureControl);
  168. }
  169. }
  170. #pragma mark - sss
  171. - (void)gestureDoubleTapped:(ZFPlayerGestureControl *)gestureControl {
  172. if (self.ybContorEvent) {
  173. self.ybContorEvent(@"控制-双击",gestureControl);
  174. }
  175. }
  176. - (void)gestureEndedPan:(ZFPlayerGestureControl *)gestureControl panDirection:(ZFPanDirection)direction panLocation:(ZFPanLocation)location;{
  177. if (direction == 2 && location == 2) {
  178. //侧滑进入个人主页
  179. if (self.ybContorEvent) {
  180. self.ybContorEvent(@"控制-主页",gestureControl);
  181. }
  182. }
  183. NSLog(@"rk_____end--dir:%lu==loc:%lu",(unsigned long)direction,(unsigned long)location);
  184. }
  185. #pragma mark - eeee
  186. -(void)controlSingleTapped {
  187. if (self.player.currentPlayerManager.isPlaying) {
  188. [[YBHomeRedObj redInstance]timerPause];
  189. [self.player.currentPlayerManager pause];
  190. NSLog(@"22222===:%lu",self.player.currentPlayerManager.playState);
  191. self.playBtn.hidden = NO;
  192. self.playBtn.transform = CGAffineTransformMakeScale(1.5f, 1.5f);
  193. [UIView animateWithDuration:0.2f delay:0
  194. options:UIViewAnimationOptionCurveEaseIn animations:^{
  195. self.playBtn.transform = CGAffineTransformIdentity;
  196. } completion:^(BOOL finished) {
  197. }];
  198. } else {
  199. [self.player.currentPlayerManager play];
  200. self.playBtn.hidden = YES;
  201. [[NSNotificationCenter defaultCenter]postNotificationName:@"lookCountGo" object:nil];
  202. }
  203. }
  204. -(void)videoMuted:(BOOL)mute{
  205. _muteChange = YES;
  206. [self.player setMuted:mute];
  207. }
  208. -(void)showPlayBtn{
  209. self.playBtn.hidden = NO;
  210. if (self.player.currentPlayerManager.isPlaying) {
  211. [self.player.currentPlayerManager pause];
  212. }
  213. }
  214. -(void)hiddenPlayBtn {
  215. [self.player.currentPlayerManager play];
  216. self.playBtn.hidden = YES;
  217. }
  218. - (void)setPlayer:(ZFPlayerController *)player {
  219. _player = player;
  220. [player.currentPlayerManager.view insertSubview:self.bgImgView atIndex:0];
  221. /*
  222. [self.bgImgView addSubview:self.effectView];
  223. */
  224. [player.currentPlayerManager.view insertSubview:self.coverImageView atIndex:1];
  225. }
  226. - (void)showCoverViewWithUrl:(NSString *)coverUrl withImageMode:(UIViewContentMode)contentMode {
  227. self.coverImageView.contentMode = contentMode;
  228. [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:coverUrl] placeholderImage:[UIImage imageNamed:@"img_video_loading"]];
  229. /*
  230. [self.bgImgView sd_setImageWithURL:[NSURL URLWithString:coverUrl] placeholderImage:[UIImage imageNamed:@"loading_bgView"]];
  231. */
  232. }
  233. #pragma mark - 打赏开始
  234. -(void)showGift:(NSDictionary *)playDic {
  235. NSString *type = minstr([playDic valueForKey:@"type"]);
  236. if (!continueGifts) {
  237. continueGifts = [[continueGift alloc]initWithFrame:CGRectMake(0, 0, liansongliwubottomview.width, liansongliwubottomview.height)];
  238. [liansongliwubottomview addSubview:continueGifts];
  239. //初始化礼物空位
  240. [continueGifts initGift];
  241. YBWeakSelf;
  242. continueGifts.rkPaintedEvent = ^(NSDictionary *giftDic) {
  243. [weakSelf showPaintedGift:giftDic];
  244. };
  245. }
  246. if ([type isEqual:@"1"]) {
  247. [self expensiveGift:playDic];
  248. }else{
  249. //手绘以及普通礼物都进 continueGifts 由它执行队列
  250. [continueGifts GiftPopView:playDic andLianSong:@"Y"];
  251. }
  252. }
  253. -(void)showPaintedGift:(NSDictionary *)giftDic {
  254. //手绘显示动画
  255. _paintedShowRegion.giftPathStr = minstr([giftDic valueForKey:@"gifticon"]);
  256. _paintedShowRegion.paintedWidth = [minstr([giftDic valueForKey:@"paintedWidth"]) floatValue];
  257. _paintedShowRegion.paintedHeight = [minstr([giftDic valueForKey:@"paintedHeight"]) floatValue];
  258. _paintedShowRegion.paintedPointArray = [NSArray arrayWithArray:[giftDic valueForKey:@"paintedPath"]];
  259. }
  260. /************ 礼物弹出及队列显示开始 *************/
  261. -(void)expensiveGiftdelegate:(NSDictionary *)giftData{
  262. if (!haohualiwuV) {
  263. haohualiwuV = [[expensiveGiftV alloc]init];
  264. haohualiwuV.delegate = self;
  265. [self addSubview:haohualiwuV];
  266. }
  267. if (giftData == nil) {
  268. }else {
  269. [haohualiwuV addArrayCount:giftData];
  270. }
  271. if(haohualiwuV.haohuaCount == 0){
  272. [haohualiwuV enGiftEspensive];
  273. }
  274. }
  275. -(void)expensiveGift:(NSDictionary *)giftData{
  276. if (!haohualiwuV) {
  277. haohualiwuV = [[expensiveGiftV alloc]init];
  278. haohualiwuV.delegate = self;
  279. [self addSubview:haohualiwuV];
  280. }
  281. if (giftData == nil) {
  282. }else {
  283. [haohualiwuV addArrayCount:giftData];
  284. }
  285. if(haohualiwuV.haohuaCount == 0){
  286. [haohualiwuV enGiftEspensive];
  287. }
  288. }
  289. #pragma mark - 打赏结束
  290. #pragma mark - getter
  291. - (UIImageView *)bgImgView {
  292. if (!_bgImgView) {
  293. _bgImgView = [[UIImageView alloc] init];
  294. _bgImgView.userInteractionEnabled = YES;
  295. //[_bgImgView setImage:[UIImage imageNamed:@"img_video_loading"]];
  296. [_bgImgView setImage:[PublicObj getImgWithColor:CellRow_Cor]];
  297. }
  298. return _bgImgView;
  299. }
  300. - (UIView *)effectView {
  301. if (!_effectView) {
  302. if (@available(iOS 8.0, *)) {
  303. UIBlurEffect *effect = [UIBlurEffect effectWithStyle:UIBlurEffectStyleDark];
  304. _effectView = [[UIVisualEffectView alloc] initWithEffect:effect];
  305. } else {
  306. UIToolbar *effectView = [[UIToolbar alloc] init];
  307. effectView.barStyle = UIBarStyleBlackTranslucent;
  308. _effectView = effectView;
  309. }
  310. }
  311. return _effectView;
  312. }
  313. - (ZFVolumeBrightnessView *)zfVolumeView {
  314. if (!_zfVolumeView) {
  315. _zfVolumeView = [[ZFVolumeBrightnessView alloc]init];
  316. _zfVolumeView.backgroundColor = RGB_COLOR(@"#000000", 0.2);
  317. }
  318. return _zfVolumeView;
  319. }
  320. - (UIButton *)playBtn {
  321. if (!_playBtn) {
  322. _playBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  323. _playBtn.userInteractionEnabled = NO;
  324. [_playBtn setImage:[UIImage imageNamed:@"icon_play_pause"] forState:UIControlStateNormal];
  325. }
  326. return _playBtn;
  327. }
  328. #pragma mark - 全屏返回按钮
  329. - (UIButton *)ttBackBtn {
  330. if (!_ttBackBtn) {
  331. _ttBackBtn = [UIButton buttonWithType:UIButtonTypeCustom];
  332. [_ttBackBtn setImage:[UIImage imageNamed:@"video_返回"] forState:0];
  333. [_ttBackBtn addTarget:self action:@selector(clickTtBackBtn) forControlEvents:UIControlEventTouchUpInside];
  334. _ttBackBtn.hidden = YES;
  335. _ttBackBtn.jk_touchAreaInsets = UIEdgeInsetsMake(20, 20, 20, 20);
  336. }
  337. return _ttBackBtn;
  338. }
  339. -(void)clickTtBackBtn {
  340. BOOL cuurentIsFull = [self.player isFullScreen];
  341. [self.player enterFullScreen:!cuurentIsFull animated:YES];
  342. }
  343. -(void)changeFullScreen:(BOOL)isFull;{
  344. _ttBackBtn.hidden = !isFull;
  345. }
  346. - (ZFSliderView *)sliderView {
  347. if (!_sliderView) {
  348. _sliderView = [[ZFSliderView alloc] init];
  349. _sliderView.delegate = self;
  350. _sliderView.maximumTrackTintColor = [UIColor colorWithRed:1 green:1 blue:1 alpha:0.2];
  351. _sliderView.minimumTrackTintColor = [UIColor whiteColor];
  352. _sliderView.bufferTrackTintColor = [UIColor clearColor];
  353. _sliderView.sliderHeight = 1;
  354. _sliderView.isHideSliderBlock = NO;
  355. _sliderView.sliderHeight = 2;
  356. _sliderView.isHideSliderBlock = NO;
  357. UIImage *pointImg = [PublicObj getImgWithColor:RGB_COLOR(@"#ffffff", 1)withSize:CGSizeMake(10, 10)];
  358. [_sliderView setThumbImage:[pointImg rk_circleImage] forState:0];
  359. // _sliderView.backgroundColor = UIColor.redColor;
  360. }
  361. return _sliderView;
  362. }
  363. -(UILabel *)timeLb{
  364. if(!_timeLb){
  365. _timeLb = [[UILabel alloc]init];
  366. _timeLb.textColor = UIColor.whiteColor;
  367. _timeLb.textAlignment = NSTextAlignmentCenter;
  368. _timeLb.font = [UIFont systemFontOfSize:14];
  369. _timeLb.hidden = YES;
  370. }
  371. return _timeLb;
  372. }
  373. - (UIImageView *)coverImageView {
  374. if (!_coverImageView) {
  375. _coverImageView = [[UIImageView alloc] init];
  376. _coverImageView.userInteractionEnabled = YES;
  377. _coverImageView.clipsToBounds = YES;
  378. }
  379. return _coverImageView;
  380. }
  381. - (RKShowPaintedView *)paintedShowRegion {
  382. if (!_paintedShowRegion) {
  383. _paintedShowRegion = [[RKShowPaintedView alloc]init];
  384. //_paintedShowRegion.backgroundColor = UIColor.redColor;
  385. }
  386. return _paintedShowRegion;
  387. }
  388. #pragma mark - ZFSliderViewDelegate
  389. - (void)sliderTouchBegan:(float)value {
  390. self.sliderView.isdragging = YES;
  391. self.timeLb.hidden = NO;
  392. }
  393. - (void)sliderTouchEnded:(float)value {
  394. if (self.player.totalTime > 0) {
  395. @zf_weakify(self)
  396. NSTimeInterval currentTime = self.player.totalTime*value;
  397. // NSLog(@"sliderTouchEnded=====current:%@",currentTime);
  398. // /// 判断是否大于免费时长
  399. // CGFloat freeTime = [minstr([_curVideoDic valueForKey:@"minute"]) floatValue] * 60;
  400. //
  401. // /// 提示判断
  402. // BOOL clickCon = [TTCatchInfo getClickContinue];
  403. // int issubscribe = [minstr([_curVideoDic valueForKey:@"issubscribe"]) intValue];
  404. //
  405. // if (issubscribe == 0 && clickCon == NO && currentTime > freeTime) {
  406. // currentTime = freeTime;
  407. // [self pauseVideo];
  408. // [self freeTimeEnd];
  409. // self.sliderView.value = currentTime/self.player.totalTime;
  410. // self.sliderView.isdragging = NO;
  411. // }
  412. // NSString *videoId = minstr([_curVideoDic valueForKey:@"id"]);
  413. // CGFloat videoOldVal = [TTCatchInfo getVideoMaxTimewithVideoid:videoId];
  414. // //NSLog(@"rk_tt-拖动结束旧的观看时长:%f",videoOldVal);
  415. // if (currentTime > videoOldVal) {
  416. // [TTCatchInfo saveVideoMaxTime:currentTime withVideoid:videoId];
  417. //NSLog(@"rk_tt-拖动结束save==>new:%f",[TTCatchInfo getVideoMaxTimewithVideoid:videoId]);
  418. // }
  419. [self.player seekToTime:currentTime completionHandler:^(BOOL finished) {
  420. @zf_strongify(self)
  421. if (finished) {
  422. self.sliderView.isdragging = NO;
  423. self.timeLb.hidden = YES;
  424. }
  425. }];
  426. } else {
  427. self.sliderView.isdragging = NO;
  428. }
  429. }
  430. - (void)sliderValueChanged:(float)value {
  431. if (self.player.totalTime == 0) {
  432. self.sliderView.value = 0;
  433. return;
  434. }
  435. self.sliderView.isdragging = YES;
  436. NSString *currentTimeString = [ZFUtilities convertTimeSecond:self.player.totalTime*value];
  437. NSString *allTimeString = [ZFUtilities convertTimeSecond:self.player.totalTime];
  438. NSLog(@"sliderTouchEnded=====currentTimeString:%@\nall:%@",currentTimeString,allTimeString);
  439. self.timeLb.text = [NSString stringWithFormat:@"%@/%@",currentTimeString,allTimeString];
  440. }
  441. - (void)sliderTapped:(float)value {
  442. if (self.player.totalTime > 0) {
  443. self.sliderView.isdragging = YES;
  444. NSTimeInterval currentTime = self.player.totalTime*value;
  445. // /// 判断是否大于免费时长
  446. // CGFloat freeTime = [minstr([_curVideoDic valueForKey:@"minute"]) floatValue] * 60;
  447. //
  448. // /// 提示判断
  449. // BOOL clickCon = [TTCatchInfo getClickContinue];
  450. // int issubscribe = [minstr([_curVideoDic valueForKey:@"issubscribe"]) intValue];
  451. //
  452. // if (issubscribe == 0 && clickCon == NO && currentTime > freeTime) {
  453. // currentTime = freeTime;
  454. // [self pauseVideo];
  455. // [self freeTimeEnd];
  456. // self.sliderView.value = currentTime/self.player.totalTime;
  457. // self.sliderView.isdragging = NO;
  458. // }
  459. // NSString *videoId = minstr([_curVideoDic valueForKey:@"id"]);
  460. // CGFloat videoOldVal = [TTCatchInfo getVideoMaxTimewithVideoid:videoId];
  461. // //NSLog(@"rk_tt-拖动结束旧的观看时长:%f",videoOldVal);
  462. // if (currentTime > videoOldVal) {
  463. // [TTCatchInfo saveVideoMaxTime:currentTime withVideoid:videoId];
  464. // //NSLog(@"rk_tt-拖动结束save==>new:%f",[TTCatchInfo getVideoMaxTimewithVideoid:videoId]);
  465. // }
  466. @zf_weakify(self)
  467. [self.player seekToTime:currentTime completionHandler:^(BOOL finished) {
  468. @zf_strongify(self)
  469. if (finished) {
  470. self.sliderView.isdragging = NO;
  471. //[self.player.currentPlayerManager play];
  472. }
  473. }];
  474. } else {
  475. self.sliderView.isdragging = NO;
  476. self.sliderView.value = 0;
  477. }
  478. }
  479. @end