耀 の 部落阁
页面内容 - 网易云音乐歌单 JS 音乐播放器 JS 代码
网易云音乐歌单 JS 音乐播放器 JS 代码
2019-1-17
2019-1-17
144
1 分钟

JS 音乐播放器截图

网易云音乐歌单 JS 音乐播放器 JS 代码

感谢 MessAPI 提供的网易云音乐 API

代码依赖 jQuery 和 fontawesome

使用方法

$.get('https://v1.itooi.cn/netease/songList', {
	'id': 998389130 // 此处歌单 ID
}, function(json){
	if (json.data != undefined && json.data != null &&
		json.data.tracks != undefined && json.data.tracks != null) {
		$('body').append(new YaoPlayer('YaoPlayer', json.data.tracks.map(song => {
      return {
        'name': song.name,
        'singer': song.artists.map(artist => artist.name).join(','),
        'lrc': 'Not found',
        'pic': song.album.picUrl,
        'url': `https://v1.itooi.cn/netease/url?id=${song.id}&quality=128`
      };
    })));
	}
}, 'json');
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16

插件全代码

{% include_code lang:javascript from:1 to:59 yaoplayer.js %}

以上内容结束 感谢您的阅读
留言