mirror of
https://github.com/zedeus/nitter.git
synced 2025-12-06 03:55:36 -05:00
Initial hls video playback support
This commit is contained in:
2
public/js/hls.light.min.js
vendored
Normal file
2
public/js/hls.light.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
15
public/js/hlsPlayback.js
Normal file
15
public/js/hlsPlayback.js
Normal file
@@ -0,0 +1,15 @@
|
||||
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();
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user