这是一个简单易用的音乐引擎,支持边下载边播放功能。
所有依赖都已设置为子模块。
只播放
NCMusicEngine *player = [[NCMusicEngine alloc] init];
player.delegate = self; // If you need...
[player playUrl:url];
NCMusicEngine默认会根据您的音乐URL生成缓存键。如果您需要自行管理,可以使用以下方法
[player playUrl:url withCacheKey:@"cachekey"];
请使用以下委派跟踪进度
- (void)engine:(NCMusicEngine *)engine didChangePlayState:(NCMusicEnginePlayState)playState;
- (void)engine:(NCMusicEngine *)engine didChangeDownloadState:(NCMusicEngineDownloadState)downloadState;
- (void)engine:(NCMusicEngine *)engine downloadProgress:(CGFloat)progress;
- (void)engine:(NCMusicEngine *)engine playProgress:(CGFloat)progress;
我会继续改进这个引擎,并添加新功能。如果在使用此引擎时遇到任何问题,请随时提出问题或与我联系