hls.js

yuhuo2022-11-26开发库工具库
参考链接

直播协议 HLS

<video id="hls_player" width="600" height="400" controls></video>
<script src="//cdn.bootcss.com/hls.js/8.0.0-beta.3/hls.min.js"></script>
<script>
    const hlsVideo = document.getElementById("hls_player");
    if (Hls.isSupported()) {
        const hls = new Hls();
        hls.loadSource("../../static/video/dog.m3u8");
        hls.attachMedia(hlsVideo);
        hls.on(Hls.Events.MANIFEST_PARSED, () => {
            hlsVideo.play();
        });
    }
</script>
Last Updated 2024/3/14 09:51:53