请问大家有没有遇到这种问题呢?
我即使按照官方示例,【建议】“代理设置”增加忽略列表选项。把code直接复制粘贴到我的开发者工具里,也是无法切换音频的播放速度。
示例如下:
示例代码:
action的method属性只能是play、pause、setPlaybackRate、setCurrentTime,用法如下:
// app-servicePage({
data: {
poster: 'http://y.gtimg.cn/music/photo_new/T002R300x300M000003rsKF44GyaSk.jpg?max_age=2592000',
name: '此时此刻',
author: '许巍',
src: 'http://ws.stream.qqmusic.qq.com/M500001VfvsJ21xFqb.mp3?guid=ffffffff82def4af4b12b3cd9337d5e7&uin=346897220&vkey=6292F51E1E384E06DCBDC9AB7C49FD713D632D313AC4858BACB8DDD29067D3C601481D36E62053BF8DFEAF74C0A5CCFADD6471160CAF3E6A&fromtag=46',
},
audioPlay: function () { this.setData({
action: {
method: 'play'
}
})
},
audioPause: function () { this.setData({
action: {
method: 'pause'
}
})
},
audioPlaybackRateSpeedUp: function () { this.setData({
action: {
method: 'setPlaybackRate',
data: 2
}
})
},
audioPlaybackRateNormal: function () { this.setData({
action: {
method: 'setPlaybackRate',
data: 1
}
})
},
audioPlaybackRateSlowDown: function () { this.setData({
action: {
method: 'setPlaybackRate',
data: 0.5
}
})
},
audio14: function () { this.setData({
action: {
method: 'setCurrentTime',
data: 14
}
})
},
audioStart: function () { this.setData({
action: {
method: 'setCurrentTime',
data: 0
}
})
}
})
谢谢!