Add syncious support to thumbnail preview
This commit is contained in:
@@ -191,14 +191,14 @@
|
||||
try {
|
||||
player.currentTime = (await getVideoProgress(data.video.videoId))[0].time;
|
||||
} catch {}
|
||||
} else {
|
||||
try {
|
||||
const playerPos = localStorage.getItem(`v_${data.video.videoId}`);
|
||||
if (playerPos) {
|
||||
player.currentTime = Number(playerPos);
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
|
||||
try {
|
||||
const playerPos = localStorage.getItem(`v_${data.video.videoId}`);
|
||||
if (playerPos) {
|
||||
player.currentTime = Number(playerPos);
|
||||
}
|
||||
} catch {}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -3,14 +3,16 @@
|
||||
import { _ } from 'svelte-i18n';
|
||||
import { get } from 'svelte/store';
|
||||
import {
|
||||
authStore,
|
||||
deArrowEnabledStore,
|
||||
interfacePreviewVideoOnHoverStore,
|
||||
playerProxyVideosStore,
|
||||
playerSavePlaybackPositionStore,
|
||||
syncPartyConnectionsStore,
|
||||
syncPartyPeerStore
|
||||
syncPartyPeerStore,
|
||||
synciousStore
|
||||
} from '../store';
|
||||
import { getDeArrow, getThumbnail, getVideo } from './Api';
|
||||
import { getDeArrow, getThumbnail, getVideo, getVideoProgress } from './Api';
|
||||
import type { Notification, PlaylistPageVideo, Video, VideoBase, VideoPlay } from './Api/model';
|
||||
import { cleanNumber, getBestThumbnail, proxyVideoUrl, videoLength } from './misc';
|
||||
import type { PlayerEvents } from './player';
|
||||
@@ -128,6 +130,12 @@
|
||||
img.onerror = () => {
|
||||
loading = false;
|
||||
};
|
||||
|
||||
if (get(synciousStore) && get(authStore)) {
|
||||
try {
|
||||
progress = (await getVideoProgress(video.videoId))[0].time.toString();
|
||||
} catch {}
|
||||
}
|
||||
});
|
||||
|
||||
function syncChangeVideo() {
|
||||
|
||||
Reference in New Issue
Block a user