From 6c9bd27fb07b984acec08a5e1f569abb417b2d2c Mon Sep 17 00:00:00 2001 From: Matt C Date: Tue, 21 Mar 2023 08:55:15 +0000 Subject: [PATCH] fix: #8374 removes global flag in customMediaPlayer patterns this means every other call to exec will work without having to exhaust all matching instances from the previous call --- source/nodejs/adaptivecards/src/card-elements.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/nodejs/adaptivecards/src/card-elements.ts b/source/nodejs/adaptivecards/src/card-elements.ts index dfc7af3b96..ed0860c19e 100644 --- a/source/nodejs/adaptivecards/src/card-elements.ts +++ b/source/nodejs/adaptivecards/src/card-elements.ts @@ -3057,19 +3057,19 @@ export class Media extends CardElement { static customMediaPlayers: ICustomMediaPlayer[] = [ { urlPatterns: [ - /^(?:https?:\/\/)?(?:www.)?youtube.com\/watch\?(?=.*v=([\w\d-_]+))(?=(?:.*t=(\d+))?).*/gi, - /^(?:https?:\/\/)?youtu.be\/([\w\d-_]+)(?:\?t=(\d+))?/gi + /^(?:https?:\/\/)?(?:www.)?youtube.com\/watch\?(?=.*v=([\w\d-_]+))(?=(?:.*t=(\d+))?).*/i, + /^(?:https?:\/\/)?youtu.be\/([\w\d-_]+)(?:\?t=(\d+))?/i ], createMediaPlayer: (matches) => new YouTubePlayer(matches, Strings.defaults.youTubeVideoPlayer()) }, { - urlPatterns: [/^(?:https?:\/\/)?vimeo.com\/([\w\d-_]+).*/gi], + urlPatterns: [/^(?:https?:\/\/)?vimeo.com\/([\w\d-_]+).*/i], createMediaPlayer: (matches) => new VimeoPlayer(matches, Strings.defaults.vimeoVideoPlayer()) }, { - urlPatterns: [/^(?:https?:\/\/)?(?:www.)?dailymotion.com\/video\/([\w\d-_]+).*/gi], + urlPatterns: [/^(?:https?:\/\/)?(?:www.)?dailymotion.com\/video\/([\w\d-_]+).*/i], createMediaPlayer: (matches) => new DailymotionPlayer(matches, Strings.defaults.dailymotionVideoPlayer()) }