2
0

🐛 (videoBubble) Fix youtube parsing for IDs containing a "-"

This commit is contained in:
Baptiste Arnaud
2023-10-13 14:11:18 +02:00
parent 9bbb30f30d
commit ee7dfbf848

View File

@ -1,7 +1,8 @@
import { VideoBubbleContentType } from '@typebot.io/schemas/features/blocks/bubbles/video/enums'
const vimeoRegex = /vimeo\.com\/(\d+)/
const youtubeRegex = /youtube\.com\/(watch\?v=|shorts\/)(\w+)|youtu\.be\/(\w+)/
const youtubeRegex =
/youtube\.com\/(watch\?v=|shorts\/)([\w-]+)|youtu\.be\/([\w-]+)/
export const parseVideoUrl = (
url: string