引入js:
<script src="https://cdn.jsdelivr.net/hls.js/latest/hls.min.js"></script>
<script>
if(Hls.isSupported()) {
var video = document.getElementById('video_'+index+''); //div的id多个,可是变量
var hls = new Hls();
hls.loadSource(''+result[0].hlsHd+''); //视频播放路径,可是变量
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
}
</script>