From ea056ee66382339fe255a4d9203c675eb71ff4c3 Mon Sep 17 00:00:00 2001 From: Wesley Luyten Date: Tue, 9 Apr 2024 10:21:42 -0500 Subject: [PATCH] feat: add Mux + hls.js support back in --- 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]+)$/