appview-less bluesky client
24
fork

Configure Feed

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

dont use #await when embedding videos, fixes the 'random' video refreshes

dawn 47f3d73a 2a633c66

+21 -5
+21 -5
src/components/EmbedMedia.svelte
··· 12 12 } 13 13 14 14 let { did, embed }: Props = $props(); 15 + 16 + let videoPds = $state<string | undefined>(); 17 + 18 + $effect(() => { 19 + if (embed.$type === 'app.bsky.embed.video' && isBlob(embed.video)) { 20 + resolveDidDoc(did).then((didDoc) => { 21 + if (didDoc.ok) videoPds = didDoc.value.pds; 22 + }); 23 + } 24 + }); 15 25 </script> 16 26 17 27 <!-- svelte-ignore a11y_no_static_element_interactions --> ··· 38 48 {/if} 39 49 {:else if embed.$type === 'app.bsky.embed.video'} 40 50 {#if isBlob(embed.video)} 41 - {#await resolveDidDoc(did) then didDoc} 42 - {#if didDoc.ok} 51 + {@const ratio = embed.aspectRatio} 52 + <div 53 + class="relative w-full overflow-hidden rounded-sm bg-black/5" 54 + style:aspect-ratio={ratio ? `${ratio.width} / ${ratio.height}` : '16 / 9'} 55 + > 56 + {#if videoPds} 43 57 <!-- svelte-ignore a11y_media_has_caption --> 44 58 <video 45 - class="rounded-sm" 46 - src={blob(didDoc.value.pds, did, embed.video.ref.$link)} 59 + class="absolute inset-0 h-full w-full" 60 + src={blob(videoPds, did, embed.video.ref.$link)} 47 61 controls 62 + playsinline 63 + loop 48 64 ></video> 49 65 {/if} 50 - {/await} 66 + </div> 51 67 {/if} 52 68 {/if} 53 69 </div>