aboutsummaryrefslogtreecommitdiff
path: root/lume/src/js/hls.js
blob: c3623333d0edbeaa5641ccea80f8d03e19c70a36 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import HLS from "npm:hls.js";

export default function execFor(id, path) {
    const video = document.getElementById(id);
    if (HLS.isSupported()) {
        const hls = new HLS();
        hls.loadSource(path);
        hls.attachMedia(video);
    } else if (video.canPlayType("application/vnd.apple.mpegurl")) {
        video.src = path;
    }
}