最近在模仿着写网易云音乐的web,后端的 api 有大牛给封装好了,可以请求到歌曲的 url地址,但是格式是 flac 格式的,不知道怎么播放,在网易云音乐网站也看不出来是用了什么标签播放的。我尝试用<audio>标签进行播放,<audio src="http://m10.music.126.net/20170529220027/dd4eae2bff7b91b7c48f687cf1e45728/ymusic/8236/9cde/95b1/5ba5330025c8417b2b3c804d5dc71acb.flac" controls="controls"></audio>
然后浏览器报错:403(forbidden):
GET http://218.12.233.20/m10.music.126.net/20170529220027/dd4eae2bff7b91b7c48f6…dc71acb.flac?wshc_tag=0&wsts_tag=592c27dd&wsid_tag=745a56c4&wsiphost=ipdbm 403 (Forbidden)
{
data: [
{
id: 347239,
url: "http://m10.music.126.net/20170529223419/fc72c69cbb357b66fada1f9a69fc75d7/ymusic/8e11/f8a0/b8c2/558e6ae83feddf96df0bafcd2b181433.flac",
br: 917669,
size: 32118434,
md5: "558e6ae83feddf96df0bafcd2b181433",
code: 200,
expi: 1200,
type: "flac",
gain: 0.05,
fee: 8,
uf: null,
payed: 1,
flag: 0,
canExtend: false
}
],
code: 200
}
上面是用网友到api请求到的歌曲信息的例子,拿回来后不会用啊。
请问怎么才能在页面中播放请求到到在线音乐资源?