Merge pull request #110 from jedmund/update-youtube-regex
Update regex to support Youtube short URLs
This commit is contained in:
commit
7bb14409a7
1 changed files with 2 additions and 1 deletions
|
|
@ -164,7 +164,8 @@ const PartyDetails = (props: Props) => {
|
|||
|
||||
function extractYoutubeVideoIds(text: string) {
|
||||
// Create a regular expression to match Youtube URLs in the text
|
||||
const youtubeUrlRegex = /https:\/\/www\.youtube\.com\/watch\?v=([\w-]+)/g
|
||||
const youtubeUrlRegex =
|
||||
/^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/watch\?v=)([^&]+)/
|
||||
|
||||
// Initialize an array to store the video IDs
|
||||
const videoIds = []
|
||||
|
|
|
|||
Loading…
Reference in a new issue