feat: yt-dlp support added and playback issues fixed

This commit is contained in:
YusufB5 2026-06-21 10:09:57 +03:00
parent 6047f8ed22
commit 0df68b97fe
3 changed files with 28 additions and 9 deletions

3
app.js
View file

@ -206,6 +206,7 @@ function connectWebSocket() {
if (seekPlayed) seekPlayed.style.transform = 'scaleX(0)';
audioOffset = 0;
scrubMeta = null; // reset so new video gets fresh thumbnails
// Lazy-load hover thumbnails: only fetch on first hover
const qIdx = currentQueueIdx;
if (seekWrap && !scrubMeta) {
@ -558,7 +559,7 @@ function skip(delta) {
function setupScrub(v) {
scrubMeta = null;
if (seekPreviewImg) seekPreviewImg.style.backgroundImage = '';
fetch('/scrub?v=' + (v || 0)).then(r => r.json()).then(m => {
fetch('/scrub?v=' + (v || 0) + '&t=' + Date.now()).then(r => r.json()).then(m => {
if (!m || !m.available || !seekPreviewImg) return;
scrubMeta = m;
seekPreviewImg.style.width = m.cellW + 'px';