🚸 Enable OneDrive video url parsing
This commit is contained in:
@ -3,6 +3,7 @@ import {
|
||||
VideoBubbleContentType,
|
||||
gumletRegex,
|
||||
horizontalVideoSuggestionSize,
|
||||
oneDriveRegex,
|
||||
tiktokRegex,
|
||||
verticalVideoSuggestionSize,
|
||||
vimeoRegex,
|
||||
@ -70,5 +71,13 @@ export const parseVideoUrl = (
|
||||
videoSizeSuggestion: horizontalVideoSuggestionSize,
|
||||
}
|
||||
}
|
||||
if (oneDriveRegex.test(url)) {
|
||||
const match = url.match(oneDriveRegex)
|
||||
const parsedUrl = match?.at(0) ?? url
|
||||
return {
|
||||
type: VideoBubbleContentType.URL,
|
||||
url: parsedUrl.replace('/embed', '/download'),
|
||||
}
|
||||
}
|
||||
return { type: VideoBubbleContentType.URL, url }
|
||||
}
|
||||
|
@ -42,6 +42,8 @@ export const tiktokRegex = /tiktok\.com\/@[\w-]+\/video\/(\d+)/
|
||||
const gumletBaseUrl = 'https://play.gumlet.io/embed'
|
||||
export const gumletRegex = /gumlet\.com\/watch\/(\w+)/
|
||||
|
||||
export const oneDriveRegex = /https:\/\/onedrive.live.com\/embed\?[^"]+/
|
||||
|
||||
export const embedBaseUrls = {
|
||||
[VideoBubbleContentType.VIMEO]: vimeoBaseUrl,
|
||||
[VideoBubbleContentType.YOUTUBE]: youtubeBaseUrl,
|
||||
|
Reference in New Issue
Block a user