mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-04-10 04:39:19 +02:00
added support for spotify playlist embeds
This commit is contained in:
parent
228c3435ee
commit
ee34fd2470
@ -127,20 +127,23 @@ const embeds: EmbedType[] = [
|
||||
// Spotify
|
||||
// note12xt2pjpwp6gec95p4cw0qzecy764f8wzgcl3z2ufkrkne4t5d2zse3ze78
|
||||
{
|
||||
regexp: /https?:\/\/open\.spotify\.com\/(track|episode|album)\/(\w+)[^\s]*/im,
|
||||
render: (match) => (
|
||||
<iframe
|
||||
style={{ borderRadius: "12px" }}
|
||||
width="100%"
|
||||
height={match[1] === "album" ? 400 : 152}
|
||||
title="Spotify Embed: Beethoven - Fur Elise - Komuz Remix"
|
||||
frameBorder="0"
|
||||
allowFullScreen
|
||||
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
||||
loading="lazy"
|
||||
src={`https://open.spotify.com/embed/${match[1]}/${match[2]}`}
|
||||
></iframe>
|
||||
),
|
||||
regexp: /https?:\/\/open\.spotify\.com\/(track|episode|album|playlist)\/(\w+)[^\s]*/im,
|
||||
render: (match) => {
|
||||
const isList = match[1] === "album" || match[1] === "playlist";
|
||||
return (
|
||||
<iframe
|
||||
style={{ borderRadius: "12px" }}
|
||||
width="100%"
|
||||
height={isList ? 400 : 152}
|
||||
title="Spotify Embed: Beethoven - Fur Elise - Komuz Remix"
|
||||
frameBorder="0"
|
||||
allowFullScreen
|
||||
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
|
||||
loading="lazy"
|
||||
src={`https://open.spotify.com/embed/${match[1]}/${match[2]}`}
|
||||
></iframe>
|
||||
);
|
||||
},
|
||||
name: "Spotify",
|
||||
isMedia: true,
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user