[READ ONLY MIRROR] Spark Social AppView Server github.com/sprksocial/server
atproto deno hono lexicon
5
fork

Configure Feed

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

fallback stories to mp4 (#43)

authored by

Davi Rodrigues and committed by
GitHub
c63b8a75 dd4c0135

+10 -3
+8 -1
utils/embed-transformer.ts
··· 45 45 embed: PostEmbed, 46 46 authorDid: string, 47 47 videoMapping?: VideoMappingDocument | null, 48 + isStory = false, 48 49 ) { 49 50 if (!embed.video) { 50 51 return undefined; ··· 56 57 if (videoMapping) { 57 58 playlist = `${env.HLS_CDN_URL}/${videoMapping.bunnyGuid}/playlist.m3u8`; 58 59 thumbnail = `${env.HLS_CDN_URL}/${videoMapping.bunnyGuid}/thumbnail.jpg`; 60 + } else if (isStory) { 61 + playlist = 62 + `https://media.sprk.so/video/${authorDid}/${embed.video.ref.$link}`; 63 + thumbnail = 64 + `https://thumb.sprk.so/${authorDid}/${embed.video.ref.$link}/thumbnail`; 59 65 } else { 60 66 playlist = 61 67 `${env.VIDEO_CDN_URL}/watch/${authorDid}/${embed.video.ref.$link}/playlist.m3u8`; ··· 77 83 authorDid: string, 78 84 videoMapping?: VideoMappingDocument | null, 79 85 options: ImageTransformOptions = {}, 86 + isStory = false, 80 87 ) { 81 88 if (!embed) { 82 89 return undefined; ··· 87 94 } 88 95 89 96 if (embed.$type === "so.sprk.embed.video") { 90 - return transformVideoEmbed(embed, authorDid, videoMapping); 97 + return transformVideoEmbed(embed, authorDid, videoMapping, isStory); 91 98 } 92 99 93 100 return undefined;
+2 -2
utils/story-transformer.ts
··· 17 17 18 18 const embedView = transformEmbed(story.media, story.authorDid, null, { 19 19 firstImageOnly: true, 20 - }); 20 + }, true); 21 21 22 22 return { 23 23 uri: story.uri, ··· 61 61 62 62 const embedView = transformEmbed(story.media, story.authorDid, null, { 63 63 firstImageOnly: true, 64 - }); 64 + }, true); 65 65 66 66 return { 67 67 uri: story.uri,