appview-less bluesky client
24
fork

Configure Feed

Select the types of activity you want to include in your feed.

check media for 'preview' media in embeds

dawn b64ffcf2 848d59bd

+17 -12
+17 -12
src/components/EmbedMedia.svelte
··· 26 26 width: (i.aspectRatio?.width ?? 4) * sizeFactor, 27 27 height: (i.aspectRatio?.height ?? 3) * sizeFactor 28 28 }; 29 + const cid = i.image.ref.$link; 30 + const isPreview = cid.startsWith('blob:'); 29 31 return { 30 32 ...size, 31 - src: img('feed_fullsize', did, i.image.ref.$link), 33 + src: isPreview ? cid : img('feed_fullsize', did, cid), 32 34 thumbnail: { 33 - src: img('feed_thumbnail', did, i.image.ref.$link), 35 + src: isPreview ? cid : img('feed_thumbnail', did, cid), 34 36 ...size 35 37 } 36 38 }; ··· 38 40 <PhotoSwipeGallery {images} /> 39 41 {:else if embed.$type === 'app.bsky.embed.video'} 40 42 {#if isBlob(embed.video)} 41 - {#await resolveDidDoc(did) then didDoc} 42 - {#if didDoc.ok} 43 - <!-- svelte-ignore a11y_media_has_caption --> 44 - <video 45 - class="rounded-sm" 46 - src={blob(didDoc.value.pds, did, embed.video.ref.$link)} 47 - controls 48 - ></video> 49 - {/if} 50 - {/await} 43 + {@const cid = embed.video.ref.$link} 44 + {@const isPreview = cid.startsWith('blob:')} 45 + {#if isPreview} 46 + <!-- svelte-ignore a11y_media_has_caption --> 47 + <video class="rounded-sm" src={cid} controls></video> 48 + {:else} 49 + {#await resolveDidDoc(did) then didDoc} 50 + {#if didDoc.ok} 51 + <!-- svelte-ignore a11y_media_has_caption --> 52 + <video class="rounded-sm" src={blob(didDoc.value.pds, did, cid)} controls></video> 53 + {/if} 54 + {/await} 55 + {/if} 51 56 {/if} 52 57 {/if} 53 58 </div>