mirror of
https://github.com/docmost/docmost.git
synced 2026-08-24 05:32:16 +10:00
fix: preserve hash in vimeo embed url
This commit is contained in:
@@ -73,9 +73,13 @@ export const embedProviders: IEmbedProvider[] = [
|
|||||||
id: "vimeo",
|
id: "vimeo",
|
||||||
name: "Vimeo",
|
name: "Vimeo",
|
||||||
regex:
|
regex:
|
||||||
/^(https:)?\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)/,
|
/^(https:)?\/\/(?:www\.|player\.)?vimeo.com\/(?:channels\/(?:\w+\/)?|groups\/([^/]*)\/videos\/|album\/(\d+)\/video\/|video\/|)(\d+)(?:\/([\da-zA-Z]+))?/,
|
||||||
getEmbedUrl: (match) => {
|
getEmbedUrl: (match, url: string) => {
|
||||||
return `https://player.vimeo.com/video/${match[4]}`;
|
// preserve ?h= hash for unlisted videos
|
||||||
|
const hash =
|
||||||
|
match[5] ?? new URL(url, "https://vimeo.com").searchParams.get("h");
|
||||||
|
const base = `https://player.vimeo.com/video/${match[4]}`;
|
||||||
|
return hash ? `${base}?h=${hash}` : base;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user