iOS 类似网易音乐播放

作者: 孤独的剑客 | 来源:发表于2016-07-05 00:12 被阅读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];

}

相关文章

网友评论

  • XH小子:注解的太简单了,楼上的确定这个是大神
  • laona:相当完美
    XH小子:@laoNa 感觉你才是大神啊
  • laona:大神,Demo来一发
    laona:@XH小子 我其实是个拖
    XH小子:@laoNa 没看出来啊

本文标题:iOS 类似网易音乐播放

本文链接:https://www.haomeiwen.com/subject/pegcjttx.html