fix(vimeo): video player is rendered for private videos and unsanitized vimeo links

This commit is contained in:
raizasafeel
2026-02-03 14:51:17 +05:30
parent c8d9b97ab7
commit dc25b408e6

View File

@@ -169,10 +169,10 @@ export function getEditorTools() {
id: ([id]) => id,
},
vimeo: {
regex: /(?:http[s]?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)/,
regex: /(?:http[s]?:\/\/)?(?:www\.)?vimeo\.com\/(\d+)(?:\/([a-zA-Z0-9]+))?(?:\?[^\s]*)?/,
embedUrl: '<%= remote_id %>',
html: `<div class="video-player" data-plyr-provider="vimeo"></div>`,
id: ([id]) => id,
id: ([id, hash]) => (hash ? `${id}?h=${hash}` : id),
},
cloudflareStream: {
regex: /https:\/\/customer-[a-z0-9]+\.cloudflarestream\.com\/([a-f0-9]{32})\/watch/,