Преглед на файлове

1.音乐暂停播放状态下,拖动进度条,音乐会播放,但按钮是暂停状态

huangxiaodong преди 11 месеца
родител
ревизия
d452d4d651
променени са 1 файла, в които са добавени 9 реда и са изтрити 1 реда
  1. 9 1
      创维盒子/双子星云手机/Class/Set/previewFile/audioPlayerViewController.m

+ 9 - 1
创维盒子/双子星云手机/Class/Set/previewFile/audioPlayerViewController.m

@@ -21,7 +21,9 @@
 #import "addAudioToPlayListViewController.h"
 
 @interface audioPlayerViewController ()<DFPlayerDelegate,DFPlayerDataSource>
-
+{
+    NSInteger playDelayed;
+}
 @property (nonatomic, strong) UIImageView*bgImageView;//中间图片
 @property (nonatomic, strong) UIImageView*playImageView;//
 @property (nonatomic, strong) CABasicAnimation *rotationAnimation;
@@ -322,6 +324,7 @@
         [self stopRotatingImage];
         [self stopPlayingRotateRightImage];
         
+        playDelayed = 0;
         [[DFPlayer sharedPlayer] df_pause];
     }
 }
@@ -720,6 +723,11 @@
 - (void)df_player:(DFPlayer *)player progress:(CGFloat)progress currentTime:(CGFloat)currentTime{
     HLog(@"音频播放进度:%f --- %f",progress,currentTime);
     
+    playDelayed ++;
+    if(!_playPauseBtn.selected && playDelayed >= 3){
+        _playPauseBtn.selected = YES;
+    }
+    
     if(_lastAudioIndex != player.currentAudioModel.audioId){
         _lastAudioIndex = player.currentAudioModel.audioId;
         _index = _lastAudioIndex;