video的后台音频播放模式怎么列表循环呢,开启loop循环播放,可以单个循环播放,我想要列表循环,可以么?谢谢
bindended() { //当播放到末尾时触发 ended 事件
const {
loop
} = this.data;
if (loop === 'all') {
const {
pay,
list,
} = this.data;
let index = pay.index;
list[index].pay = null;
index++
if (index > list.length - 1) {
index = 0
}
list[index].pay = true;
Object.assign(pay, list[index]);
pay.index = index;
this.setData({
list,
pay
})
wx.createVideoContext('myVideo').play();
}
},
onReady() {//生命周期函数--监听页面初次渲染完成
this.videoContext = wx.createVideoContext('myVideo')
},
onHide() {//生命周期函数--监听页面隐藏
const {
pause,
backstagePlay
} = this.data;
if (pause && backstagePlay) { //进入后台音频播放模式。
this.videoContext.requestBackgroundPlayback()
this.videoContext.play()
}
},