From df110734be8c1f98bfddba691b0d1b968d6299b7 Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Tue, 9 Apr 2024 10:51:51 -0500 Subject: [PATCH] feat: add Mux + hls.js support back in (#1769) --- src/patterns.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/patterns.js b/src/patterns.js index 25a96c84..6f82585b 100644 --- a/src/patterns.js +++ b/src/patterns.js @@ -3,7 +3,8 @@ import { isMediaStream, isBlobUrl } from './utils' export const MATCH_URL_YOUTUBE = /(?:youtu\.be\/|youtube(?:-nocookie|education)?\.com\/(?:embed\/|v\/|watch\/|watch\?v=|watch\?.+&v=|shorts\/|live\/))((\w|-){11})|youtube\.com\/playlist\?list=|youtube\.com\/user\// export const MATCH_URL_SOUNDCLOUD = /(?:soundcloud\.com|snd\.sc)\/[^.]+$/ export const MATCH_URL_VIMEO = /vimeo\.com\/(?!progressive_redirect).+/ -export const MATCH_URL_MUX = /stream\.mux\.com\/(\w+)/ +// Match Mux m3u8 URLs without the extension so users can use hls.js with Mux by adding the `.m3u8` extension. https://regexr.com/7um5f +export const MATCH_URL_MUX = /stream\.mux\.com\/(?!\w+\.m3u8)(\w+)/ 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]+)$/