Replies: 3 comments
|
I think, it's a good idea, I like preload too. |
|
Hi @picarica, You're very close — your script and logic look good, but the main issue causing the 404 error is that you're using the wrong In your current code, you're doing: MediaSourceId=${videoId}However, To fix this, you should first fetch the correct async function getMediaSourceId(videoId, apiKey, serverUrl) {
const response = await fetch(`${serverUrl}/Videos/${videoId}?api_key=${apiKey}`);
const data = await response.json();
return data?.MediaSources?.[0]?.Id;
}Then update your trickplay image URL to use the correct media source ID: const mediaSourceId = await getMediaSourceId(videoId, sessionInfo.apiKey, sessionInfo.serverUrl);
const url = `${sessionInfo.serverUrl}/Videos/${videoId}/Trickplay/${config.resolution}/${i}.jpg?api_key=${sessionInfo.apiKey}&MediaSourceId=${mediaSourceId}`;Also, make sure:
Once you apply these changes, your image preloading should start working without 404 errors. Let me know if you'd like help turning this into a plugin later. You're on the right track. – \Ruchika |
|
I've implemented this in branch: https://github.com/rzalawad/jellyfin-web/tree/feature/preload-trickplay-images |
Uh oh!
There was an error while loading. Please reload this page.
so i was a bit suprised when i couldnt find any thread on this, trickplay images work fine, but when hovering there is about 300ms delay between image being shown, i tried implementing something, i was confused about using jellyfin API i even tried AI for help, and i couldnt make it work, i can see in network tab the requested url is correct, but it results in404 error,
this is the stuff i tried
wanted to make it into plugin later on ,but even this doesnt work
All reactions