Created
January 6, 2022 23:04
-
-
Save mayli/6139696d16e780eb1008c50b81ecad1a to your computer and use it in GitHub Desktop.
bGojpxg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="v"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// var video = document.getElementById("video"); | |
for(i=1;i < 18;i ++){ | |
const video = document.createElement("video"); | |
video.setAttribute("height", 120); video.setAttribute("control", 1); | |
const currentDiv = document.getElementById("v"); | |
document.body.insertBefore(video, currentDiv); | |
if (Hls.isSupported()) { | |
var hls = new Hls({ | |
debug: true | |
}); | |
hls.loadSource("https://iptv.jmsooo.com/live/cctv"+i+"/index.m3u8"); | |
hls.attachMedia(video); | |
hls.on(Hls.Events.MEDIA_ATTACHED, function () { | |
video.muted = true; | |
video.play(); | |
}); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="https://cdnjs.cloudflare.com/ajax/libs/hls.js/1.1.2/hls.min.js"></script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment