|
@@ -453,6 +453,10 @@ NSString * const DFPlaybackLikelyToKeepUpKey = @"playbackLikelyToKeepUp";
|
|
|
[self df_play];
|
|
|
[self addProgressObserver];
|
|
|
[self addPlayingCenterInfo];
|
|
|
+
|
|
|
+ NSInteger index = self.currentAudioModel.audioId;
|
|
|
+ //HLog(@"audioId:%ld",self.currentAudioModel.audioId);
|
|
|
+ [self audioPlayerByIndex:index];
|
|
|
}
|
|
|
|
|
|
- (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context{
|
|
@@ -959,7 +963,28 @@ NSString * const DFPlaybackLikelyToKeepUpKey = @"playbackLikelyToKeepUp";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-
|
|
|
+#pragma mark 音频可以播放 保存最近文件和歌曲缓存
|
|
|
+- (void)audioPlayerByIndex:(NSInteger)index{
|
|
|
+ if(index >=0 && index < _allAudioDataArray.count){
|
|
|
+ NASFileAudioDataModel *dataModel = _allAudioDataArray[index];
|
|
|
+
|
|
|
+ lastFileModel *lastFileMod = [lastFileModel new];
|
|
|
+ lastFileMod.path = dataModel.path;
|
|
|
+ lastFileMod.name = dataModel.name;
|
|
|
+ lastFileMod.time = dataModel.time;
|
|
|
+ lastFileMod.size = dataModel.size;
|
|
|
+ lastFileMod.duration = dataModel.duration;
|
|
|
+ lastFileMod.type = @"audio";
|
|
|
+ lastFileMod.lastPreTime = [iTools getNowTimeStamp];
|
|
|
+
|
|
|
+ //本地缓存
|
|
|
+ lastFileMod.localPath = [[audioPlayListManager shareManager] getAudioCacheFullPathBy:dataModel.name];
|
|
|
+
|
|
|
+ [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
|
|
|
+ [[audioPlayListManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
|
|
|
+
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
@end
|
|
|
|