feat(web): use thumbhash as a cache key (#16106)

Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
Jason Rasmussen 2025-02-15 22:34:13 -05:00 committed by GitHub
parent c524fcf084
commit f386b4d377
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 41 additions and 38 deletions

View file

@ -13,7 +13,7 @@
interface Props {
assetId: string;
loopVideo: boolean;
checksum: string;
cacheKey: string | null;
onPreviousAsset?: () => void;
onNextAsset?: () => void;
onVideoEnded?: () => void;
@ -24,7 +24,7 @@
let {
assetId,
loopVideo,
checksum,
cacheKey,
onPreviousAsset = () => {},
onNextAsset = () => {},
onVideoEnded = () => {},
@ -39,7 +39,7 @@
onMount(() => {
if (videoPlayer) {
assetFileUrl = getAssetPlaybackUrl({ id: assetId, checksum });
assetFileUrl = getAssetPlaybackUrl({ id: assetId, cacheKey });
forceMuted = false;
videoPlayer.load();
}
@ -106,7 +106,7 @@
onclose={() => onClose()}
muted={forceMuted || $videoViewerMuted}
bind:volume={$videoViewerVolume}
poster={getAssetThumbnailUrl({ id: assetId, size: AssetMediaSize.Preview, checksum })}
poster={getAssetThumbnailUrl({ id: assetId, size: AssetMediaSize.Preview, cacheKey })}
src={assetFileUrl}
>
</video>