Browse Source

1.音频播放列表点击播放bug

huangxiaodong 1 year ago
parent
commit
96dd29c9a1

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

@@ -553,6 +553,10 @@
     _audioPlayListV.didClickDeleteFun = ^(lastFileModel * _Nonnull dataModel) {
         [weakSelf deleteAudioToListBy:dataModel];
     };
+    
+    _audioPlayListV.didClickAudioFun = ^(NSInteger row) {
+        [[DFPlayer sharedPlayer] df_playWithAudioId:row];
+    };
 }
 
 #pragma mark 处理本地是否需要添加新加的的音乐

+ 1 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/audioPlayListView.h

@@ -14,6 +14,7 @@ NS_ASSUME_NONNULL_BEGIN
 @property (nonatomic,assign) NSInteger playingIndex;
 @property (nonatomic,copy) void (^didClickButtonFun)(void);
 @property (nonatomic,copy) void (^didClickDeleteFun)(lastFileModel* dataModel);
+@property (nonatomic,copy) void (^didClickAudioFun)(NSInteger row);
 - (id)initWithFrame:(CGRect)frame withIndex:(NSInteger)index;
 - (void)reGetDataFun;
 @end

+ 10 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/audioPlayListView.m

@@ -199,6 +199,16 @@
     return cell;
 }
 
+- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    NSInteger row = indexPath.row;
+    if(row < _curDataArr.count){
+        if(_didClickAudioFun){
+            _didClickAudioFun(row);
+        }
+    }
+}
+
 - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
     return 70;
 }