mirror of
https://github.com/zedeus/nitter.git
synced 2024-11-18 06:44:50 +00:00
15 lines
476 B
JavaScript
15 lines
476 B
JavaScript
function playVideo(overlay) {
|
|
const video = overlay.parentElement.querySelector('video');
|
|
video.setAttribute("controls", "");
|
|
overlay.style.display = "none";
|
|
|
|
const url = video.getAttribute("data-url");
|
|
var hls = new Hls({autoStartLoad: false});
|
|
hls.loadSource(url);
|
|
hls.attachMedia(video);
|
|
hls.on(Hls.Events.MANIFEST_PARSED, function () {
|
|
hls.loadLevel = hls.levels.length - 1;
|
|
hls.startLoad();
|
|
video.play();
|
|
});
|
|
}
|