Add Riverside support
This commit is contained in:
@@ -25,6 +25,7 @@ export const embedPlayerSources = [
|
|||||||
'giphy',
|
'giphy',
|
||||||
'tenor',
|
'tenor',
|
||||||
'flickr',
|
'flickr',
|
||||||
|
'riverside',
|
||||||
] as const
|
] as const
|
||||||
|
|
||||||
export type EmbedPlayerSource = (typeof embedPlayerSources)[number]
|
export type EmbedPlayerSource = (typeof embedPlayerSources)[number]
|
||||||
@@ -45,6 +46,7 @@ export type EmbedPlayerType =
|
|||||||
| 'giphy_gif'
|
| 'giphy_gif'
|
||||||
| 'tenor_gif'
|
| 'tenor_gif'
|
||||||
| 'flickr_album'
|
| 'flickr_album'
|
||||||
|
| 'riverside'
|
||||||
|
|
||||||
export const externalEmbedLabels: Record<EmbedPlayerSource, string> = {
|
export const externalEmbedLabels: Record<EmbedPlayerSource, string> = {
|
||||||
youtube: 'YouTube',
|
youtube: 'YouTube',
|
||||||
@@ -57,6 +59,7 @@ export const externalEmbedLabels: Record<EmbedPlayerSource, string> = {
|
|||||||
appleMusic: 'Apple Music',
|
appleMusic: 'Apple Music',
|
||||||
soundcloud: 'SoundCloud',
|
soundcloud: 'SoundCloud',
|
||||||
flickr: 'Flickr',
|
flickr: 'Flickr',
|
||||||
|
riverside: 'Riverside',
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface EmbedPlayerParams {
|
export interface EmbedPlayerParams {
|
||||||
@@ -85,6 +88,13 @@ export function parseEmbedPlayerFromUrl(
|
|||||||
return undefined
|
return undefined
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (urlp.hostname.endsWith('riverside.fm')) {
|
||||||
|
return {
|
||||||
|
type: 'riverside',
|
||||||
|
source: 'riverside',
|
||||||
|
playerUri: urlp.href,
|
||||||
|
}
|
||||||
|
}
|
||||||
// youtube
|
// youtube
|
||||||
if (urlp.hostname === 'youtu.be') {
|
if (urlp.hostname === 'youtu.be') {
|
||||||
const videoId = urlp.pathname.split('/')[1]
|
const videoId = urlp.pathname.split('/')[1]
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ const schema = z.object({
|
|||||||
appleMusic: z.enum(externalEmbedOptions).optional(),
|
appleMusic: z.enum(externalEmbedOptions).optional(),
|
||||||
soundcloud: z.enum(externalEmbedOptions).optional(),
|
soundcloud: z.enum(externalEmbedOptions).optional(),
|
||||||
flickr: z.enum(externalEmbedOptions).optional(),
|
flickr: z.enum(externalEmbedOptions).optional(),
|
||||||
|
riverside: z.enum(externalEmbedOptions).optional(),
|
||||||
})
|
})
|
||||||
.optional(),
|
.optional(),
|
||||||
invites: z.object({
|
invites: z.object({
|
||||||
|
|||||||
Reference in New Issue
Block a user