diff --git a/src/components/EmbedMedia.svelte b/src/components/EmbedMedia.svelte index 1b2699e..ec6c365 100644 --- a/src/components/EmbedMedia.svelte +++ b/src/components/EmbedMedia.svelte @@ -12,6 +12,16 @@ } let { did, embed }: Props = $props(); + + let videoPds = $state(); + + $effect(() => { + if (embed.$type === 'app.bsky.embed.video' && isBlob(embed.video)) { + resolveDidDoc(did).then((didDoc) => { + if (didDoc.ok) videoPds = didDoc.value.pds; + }); + } + }); @@ -38,16 +48,22 @@ {/if} {:else if embed.$type === 'app.bsky.embed.video'} {#if isBlob(embed.video)} - {#await resolveDidDoc(did) then didDoc} - {#if didDoc.ok} + {@const ratio = embed.aspectRatio} +
+ {#if videoPds} {/if} - {/await} +
{/if} {/if}