Skip to content

Commit

Permalink
fix: microsoft#8374 removes global flag in customMediaPlayer patterns
Browse files Browse the repository at this point in the history
this means every other call to exec will work without having to exhaust all matching instances from the previous call
  • Loading branch information
Proxatonin committed Mar 21, 2023
1 parent 50a7c52 commit 6c9bd27
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/nodejs/adaptivecards/src/card-elements.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down

0 comments on commit 6c9bd27

Please sign in to comment.