id="my_video_1"
class="video-js vjs-default-skin vjs-big-play-centered my_video_1"
preload="auto"
autoplay='autoplay'
controls='controls'
data-setup='{}'>
目前的做法是多个视频的播放url存储在urlList里面,然后用v-for遍历才存放到source里面的src。
初始化的代码在这
if (this.urlList.length > 1) {
this.urlList.map((val, index) => {
this.player.push(videoJs(document.querySelectorAll('#my_video_1')[index], {flash: options, html5: options}));
});
this.player.map((item) => {
item.play();
});
} else {
this.player.push(videoJs(document.querySelector('#my_video_1'), {flash: options, html5: options}));
this.player[0].play();
}
这样并没有起作用,有没有大佬帮帮忙