Support .gif, .webm, and .mp4 files in the embed player
This commit is contained in:
@@ -10,6 +10,7 @@ export type EmbedPlayerParams =
|
||||
| {type: 'spotify_song'; songId: string; playerUri: string}
|
||||
| {type: 'soundcloud_track'; user: string; track: string; playerUri: string}
|
||||
| {type: 'soundcloud_set'; user: string; set: string; playerUri: string}
|
||||
| {type: 'gif'; playerUri: string}
|
||||
|
||||
export function parseEmbedPlayerFromUrl(
|
||||
url: string,
|
||||
@@ -111,6 +112,18 @@ export function parseEmbedPlayerFromUrl(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// gifs
|
||||
if (
|
||||
urlp.pathname.endsWith('.gif') ||
|
||||
urlp.pathname.endsWith('.webm') ||
|
||||
urlp.pathname.endsWith('.mp4')
|
||||
) {
|
||||
return {
|
||||
type: 'gif',
|
||||
playerUri: url,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export function getPlayerHeight({
|
||||
|
||||
Reference in New Issue
Block a user