<div class="video_wrapper" v-for="item in urlList">
<video
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="{}">
<source :src="item.m3u8_url" type="application/x-mpegURL">
</video>
</div>
the current practice is that the playback url of multiple videos is stored in urlList
, and then stored in the src in source
using v-for traversal.
the initialization code is here
if (this.urlList.length > 1) {
this.urlList.map((val, index) => {
this.player.push(videoJs(document.querySelectorAll("-sharpmy_video_1")[index], {flash: options, html5: options}));
});
this.player.map((item) => {
item.play();
});
} else {
this.player.push(videoJs(document.querySelector("-sharpmy_video_1"), {flash: options, html5: options}));
this.player[0].play();
}
this doesn"t work. Is there a boss to help