From 02ae312eef62593347111df35ce863ea507df79b Mon Sep 17 00:00:00 2001 From: Pete Cook Date: Wed, 28 Oct 2020 21:18:06 +0000 Subject: [PATCH] Add support for fb.watch URLs Fixes https://github.com/cookpete/react-player/issues/1061 --- src/patterns.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/patterns.js b/src/patterns.js index 7d2132c0..a0a6abfc 100644 --- a/src/patterns.js +++ b/src/patterns.js @@ -4,6 +4,7 @@ export const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/(?: export const MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/ export const MATCH_URL_VIMEO = /vimeo\.com\/.+/ export const MATCH_URL_FACEBOOK = /^https?:\/\/(www\.)?facebook\.com.*\/(video(s)?|watch|story)(\.php?|\/).+$/ +export const MATCH_URL_FACEBOOK_WATCH = /^https?:\/\/fb\.watch\/.+$/ export const MATCH_URL_STREAMABLE = /streamable\.com\/([a-z0-9]+)$/ export const MATCH_URL_WISTIA = /(?:wistia\.com|wi\.st)\/(?:medias|embed)\/(.*)$/ export const MATCH_URL_TWITCH_VIDEO = /(?:www\.|go\.)?twitch\.tv\/videos\/(\d+)($|\?)/ @@ -50,7 +51,7 @@ export const canPlay = { }, soundcloud: url => MATCH_URL_SOUNDCLOUD.test(url) && !AUDIO_EXTENSIONS.test(url), vimeo: url => MATCH_URL_VIMEO.test(url) && !VIDEO_EXTENSIONS.test(url) && !HLS_EXTENSIONS.test(url), - facebook: url => MATCH_URL_FACEBOOK.test(url), + facebook: url => MATCH_URL_FACEBOOK.test(url) || MATCH_URL_FACEBOOK_WATCH.test(url), streamable: url => MATCH_URL_STREAMABLE.test(url), wistia: url => MATCH_URL_WISTIA.test(url), twitch: url => MATCH_URL_TWITCH_VIDEO.test(url) || MATCH_URL_TWITCH_CHANNEL.test(url),