2020.12.26测试有效(但失效很快)
- 打开网易云歌曲
- 打开Network
- 播放 找v1开头(其他另说)
- 使用
/**
* 当小程序启动,或从后台进入前台显示,会触发 onShow
*/
onShow: function (options) {
this.innerAudioContext = wx.createInnerAudioContext() //播放按钮
this.innerAudioContext.autoplay = true
this.innerAudioContext.src = 'http://m801.music.126.net/20201225233615/2cdaa8db222f5363657af0b357283e4c/jdyyaac/obj/w5rDlsOJwrLDjj7CmsOj/4525536197/0b65/29b3/51dd/baa93d6f551d21110bc99a4d05e38625.m4a'
this.innerAudioContext.onError((res) => {
console.log(res.errMsg)
console.log(res.errCode)
})
},
//播放
btnClick1:function(){
this.innerAudioContext.play()
},
//暂停
btnClick2: function () {
this.innerAudioContext.pause()
},
//停止
btnClick3: function () {
this.innerAudioContext.stop()
}
酷我音乐mp3外链地址
- 打开酷狗歌曲 -> 找到地址栏ID -> 拼接好链接
http://player.kuwo.cn/webmusic/st/getNewMuiseByRid?rid=MUSIC_24165853
- 找到图中标签
- 找到mp3path(音频尾部地址)和mp3dl(音频头部地址)
打开新组建的网址,http://+音频头部地址+/resource/+音频尾部地址,如下:http://other.web.ri01.sycdn.kuwo.cn/resource/n2/96/19/2142954236.mp3