feat: youtube livestream iframe
This commit is contained in:
1 parent
b93729f4ac
commit
eaf42a38b3
2 files changed
+2
-2
No files matched your search
@@ -56,7 +56,7 @@ export const optimizeImageURL = (
|
|||||||
}
|
}
|
||||||
|
|
||||||
const YOUTUBE_REGEX =
|
const YOUTUBE_REGEX =
|
||||||
/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|live\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
||||||
|
|
||||||
export const isYoutubeLink = (url?: string): RegExpMatchArray | null => {
|
export const isYoutubeLink = (url?: string): RegExpMatchArray | null => {
|
||||||
if (!url) return null
|
if (!url) return null
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
|
|
||||||
function youtubeVideoID(url: string): string | null {
|
function youtubeVideoID(url: string): string | null {
|
||||||
const regex =
|
const regex =
|
||||||
/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
/^(?:https?:\/\/)?(?:www\.|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|shorts\/|live\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
||||||
const match = url.match(regex)
|
const match = url.match(regex)
|
||||||
|
|
||||||
if (match && match[1]) {
|
if (match && match[1]) {
|
||||||
|
|||||||
Reference in new issue
Block a user