Mark'sBLOG
CARD
jinyaoMa
issue, func, flow, std, solve
15 | 8 | 24
SKIN
SETTINGS
Night Shift
Disable Canvas
简体中文
中文
|
English
|
日本語
PAGE CONTENT
网易云音乐歌单 JS 音乐播放器 JS 代码
2019-01-17
2019-01-17
144
1 min.

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');

# 插件全代码

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

The post above ended Thanks for your reading
Come on! Write some comments, and your suggestions will improve the quality of my creative!
FRIEND ME
QQ
WeChat
Post Author: jinyaoMa
Post Link: /
Copyright Notice: All articles/posts in this website are licensed under BY-NC-SA unless stating additionally.
Enable Read Mode
COMMENTS
DEFAULT