最近要写一个自动播放下一集的功能:前提是:当前页面是一个列表,播放完一个,在播放下一个
var player = new Aliplayer({
id: 'MPSplayer',
width: that.screenWidth - Number(width),
height: that.screenHeight,
autoplay: true,
source: ’阿里云回放地址‘,
videoWidth: "100%",
}, function(player) {
player.on("ended", function(e) {
//这里直接写播放下一集的逻辑即可
})
})
使用以上代码即可实现监听回放,播放下一集