视图
<video
ref="videoPlayerList"
class="video-js"
autoplay
style="width:100%; height:100%"
></video>
初始化
// data
playerList: null, // 实例
playerListSrc: null, // 当前的播放地址
playerListOption: {
autoplay: true,
controls: true,
// 视频封面
// poster: require("../assets/images/***.png"),
},
// mounted
this.playerList = videojs(this.$refs.videoPlayerList, this.playerListOption, function onPlayerReady(res) {
console.log("onPlayerReady", this);
});
// 获取到地址后 添加播放地址
this.playerList.src({ src: '***.m3u8' });
销毁
destroyed()
if (this.playerList) {
this.playerList.dispose();
}
}
Copyright © 2008-2022 秒下下载站
m.down10s.com .All Rights Reserved