this repo has no description

Support for displaying GIFs

astrra.space a26f0383 79d5694d

verified
Changed files
+12
src
+7
src/lib/PostComponent.svelte
··· 141 141 controls 142 142 ></video> 143 143 {/if} 144 + {#if post.gifLink} 145 + <img 146 + id="embedVideo" 147 + src="{post.gifLink}" 148 + alt="Post GIF" 149 + /> 150 + {/if} 144 151 </div> 145 152 </div> 146 153
+5
src/lib/pdsfetch.ts
··· 46 46 replyingUri: atUriObject | null; 47 47 imagesCid: string[] | null; 48 48 videosLinkCid: string | null; 49 + gifLink: string | null; 49 50 50 51 constructor( 51 52 record: ComAtprotoRepoListRecords.Record, ··· 69 70 this.quotingUri = null; 70 71 this.imagesCid = null; 71 72 this.videosLinkCid = null; 73 + this.gifLink = null; 72 74 switch (post.embed?.$type) { 73 75 case "app.bsky.embed.images": 74 76 this.imagesCid = post.embed.images.map( ··· 95 97 96 98 break; 97 99 } 100 + break; 101 + case "app.bsky.embed.external": // assuming that external embeds are gifs for now 102 + this.gifLink = post.embed.external.uri; 98 103 break; 99 104 } 100 105 }