Stream refreshed media for playback and view full
This commit is contained in:
@@ -21,6 +21,8 @@ export interface ExtractedMedia {
|
||||
kind: MediaKind;
|
||||
url: string;
|
||||
source: MediaSource;
|
||||
/** Direct playable file URL when the embed carries one (gifv/Tenor mp4). */
|
||||
playUrl: string | null;
|
||||
provider: string | null;
|
||||
contentType: string | null;
|
||||
size: number | null;
|
||||
@@ -73,6 +75,7 @@ function extractEmbed(embed: CoreEmbed): ExtractedMedia | null {
|
||||
const provider = embed.provider ?? hostname(embed.url);
|
||||
const common = {
|
||||
source: "embed" as const,
|
||||
playUrl: embed.videoUrl ?? null,
|
||||
provider,
|
||||
downloaded: false,
|
||||
size: null,
|
||||
@@ -123,6 +126,7 @@ function extractSticker(sticker: CoreSticker): ExtractedMedia | null {
|
||||
return {
|
||||
kind: ext === "gif" ? "gif" : "image",
|
||||
source: "sticker",
|
||||
playUrl: null,
|
||||
url: `https://cdn.discordapp.com/stickers/${sticker.id}.${ext}`,
|
||||
provider: "discord",
|
||||
contentType: null,
|
||||
@@ -145,6 +149,7 @@ function extractFrom(message: MediaMessage): ExtractedMedia[] {
|
||||
items.push({
|
||||
kind,
|
||||
source: "attachment",
|
||||
playUrl: null,
|
||||
url: attachment.url,
|
||||
provider: "discord",
|
||||
contentType: attachment.contentType,
|
||||
|
||||
Reference in New Issue
Block a user