2023-01-25 11:27:47 +01:00
|
|
|
export enum VideoBubbleContentType {
|
|
|
|
URL = 'url',
|
|
|
|
YOUTUBE = 'youtube',
|
|
|
|
VIMEO = 'vimeo',
|
2023-11-10 11:17:14 +01:00
|
|
|
TIKTOK = 'tiktok',
|
|
|
|
GUMLET = 'gumlet',
|
2023-01-25 11:27:47 +01:00
|
|
|
}
|
2023-11-08 15:34:16 +01:00
|
|
|
|
2023-11-10 11:17:14 +01:00
|
|
|
export const embeddableVideoTypes = [
|
|
|
|
VideoBubbleContentType.YOUTUBE,
|
|
|
|
VideoBubbleContentType.VIMEO,
|
|
|
|
VideoBubbleContentType.TIKTOK,
|
|
|
|
VideoBubbleContentType.GUMLET,
|
|
|
|
] as const
|
|
|
|
|
2023-11-08 15:34:16 +01:00
|
|
|
export const defaultVideoBubbleContent = {
|
|
|
|
height: 400,
|
2023-11-10 11:17:14 +01:00
|
|
|
aspectRatio: '16/9',
|
|
|
|
maxWidth: '100%',
|
|
|
|
} as const
|
|
|
|
|
|
|
|
export const horizontalVideoSuggestionSize = {
|
|
|
|
aspectRatio: '16/9',
|
|
|
|
maxWidth: '100%',
|
|
|
|
}
|
|
|
|
|
|
|
|
export const verticalVideoSuggestionSize = {
|
|
|
|
aspectRatio: '9/16',
|
|
|
|
maxWidth: '400px',
|
|
|
|
}
|
|
|
|
|
|
|
|
const youtubeBaseUrl = 'https://www.youtube.com/embed'
|
|
|
|
export const youtubeRegex =
|
|
|
|
/youtube\.com\/(watch\?v=|shorts\/)([\w-]+)|youtu\.be\/([\w-]+)/
|
|
|
|
|
|
|
|
const vimeoBaseUrl = 'https://player.vimeo.com/video'
|
|
|
|
export const vimeoRegex = /vimeo\.com\/(\d+)/
|
|
|
|
|
|
|
|
const tiktokBaseUrl = 'https://www.tiktok.com/embed/v2'
|
|
|
|
export const tiktokRegex = /tiktok\.com\/@[\w-]+\/video\/(\d+)/
|
|
|
|
|
|
|
|
const gumletBaseUrl = 'https://play.gumlet.io/embed'
|
|
|
|
export const gumletRegex = /gumlet\.com\/watch\/(\w+)/
|
|
|
|
|
|
|
|
export const embedBaseUrls = {
|
|
|
|
[VideoBubbleContentType.VIMEO]: vimeoBaseUrl,
|
|
|
|
[VideoBubbleContentType.YOUTUBE]: youtubeBaseUrl,
|
|
|
|
[VideoBubbleContentType.TIKTOK]: tiktokBaseUrl,
|
|
|
|
[VideoBubbleContentType.GUMLET]: gumletBaseUrl,
|
2023-11-08 15:34:16 +01:00
|
|
|
} as const
|