1
0
mirror of https://github.com/zedeus/nitter.git synced 2026-04-15 18:22:11 -04:00

Add support for broadcasts

Fixes #303
This commit is contained in:
Zed
2026-03-31 01:34:20 +02:00
parent 7d431781c3
commit 8114eefa19
18 changed files with 338 additions and 41 deletions

View File

@@ -3,6 +3,7 @@
function playVideo(overlay) {
const video = overlay.parentElement.querySelector('video');
const url = video.getAttribute("data-url");
const startTime = parseFloat(video.getAttribute("data-start") || "0");
video.setAttribute("controls", "");
overlay.style.display = "none";
@@ -12,12 +13,13 @@ function playVideo(overlay) {
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED, function () {
hls.loadLevel = hls.levels.length - 1;
hls.startLoad();
hls.startLoad(startTime);
video.play();
});
} else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = url;
video.addEventListener('canplay', function() {
if (startTime > 0) video.currentTime = startTime;
video.play();
});
}