mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-09-19 20:11:31 +02:00
support youtu.be links
This commit is contained in:
@@ -21,7 +21,8 @@ export function renderYoutubeUrl(match: URL) {
|
||||
|
||||
const { youtubeRedirect } = appSettings.value;
|
||||
|
||||
const videoId = match.searchParams.get("v");
|
||||
var videoId = match.searchParams.get("v");
|
||||
if (match.hostname === "youtu.be") videoId = match.pathname.split("/")[1];
|
||||
if (!videoId) throw new Error("cant find video id");
|
||||
const embedUrl = new URL(`/embed/${videoId}`, youtubeRedirect || "https://youtube.com");
|
||||
|
||||
|
Reference in New Issue
Block a user