iOS 类似网易音乐播放
2016-07-05 本文已影响525人
孤独的剑客
OC 版本
[下载地址]https://git.oschina.net/mrj_mrj/music.git
效果:
音乐.gif<p>Here is an example of AppleScript:</p><pre><code>
// 初始化播放器
_audioPlayer1 = [[STKAudioPlayer alloc] initWithOptions:(STKAudioPlayerOptions){ .flushQueueOnSeek = YES, .enableVolumeMixer = NO, .equalizerBandFrequencies = {50, 100, 200, 400, 800, 1600, 2600, 16000} }];
_audioPlayer1.meteringEnabled = YES;
_audioPlayer1.volume = 1;
// 初始化自定义的播放器形式比如网易音乐
_player = [MrjPlayer shareInstance];
_player.slider = _timeSlider;
_player.currentLabel = _currentLabel;
_player.surplusLabel = _surplusLabel;
_player.animationImg = _animationImg;
_player.audioPlayer = _audioPlayer1;
</code></pre>
<p>Here is an example of AppleScript:</p><pre><code>
// 初始化无限轮播
_palyView = [[SDCycleScrollView alloc] initWithFrame:CGRectMake(0, 0, 200, 200)];
_palyView.center = self.view.center;
[self.view addSubview:_palyView];
_palyView.autoScroll = NO;
_palyView.delegate = self;
_palyView.showPageControl = NO;
_palyView.imageURLStringsGroup = _dataArray;
</code></pre>
<p>Here is an example of AppleScript:</p><pre><code>
// 类似网易音乐轮播形式
-
(void)cycleScrollow:(BOOL)isLeft
{[self dataConfig:isLeft];
_palyView.imageURLStringsGroup = _dataArray;
musicModel *model = _showArray[0];
_player.url = model.url;
[_player play];
}
</code></pre>// 类似网易音乐轮播形式
- (void)cycleScrollow:(BOOL)isLeft
{
[self dataConfig:isLeft];
_palyView.imageURLStringsGroup = _dataArray;
musicModel *model = _showArray[0];
_player.url = model.url;
[_player play];
}