mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-11 05:09:36 +02:00
support youtu.be links
This commit is contained in:
parent
dcfc011dea
commit
cc77e0d089
@ -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");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user