Update Wavlake embed URL, add support for album & artist links (#439)

* Update wavlake embed url

* Make regex more explicit, remove allow from iframe

* Prettify changes
This commit is contained in:
Michael Rhee
2023-03-14 12:07:59 -05:00
committed by GitHub
parent 877d018da3
commit 2b0cd75f98
3 changed files with 5 additions and 5 deletions

View File

@ -1,14 +1,13 @@
const WavlakeEmbed = ({ link }: { link: string }) => {
const convertedUrl = link.replace(/\/(track)\/([a-zA-Z0-9]+)/, "/embed/$1/$2");
const convertedUrl = link.replace("player.wavlake.com", "embed.wavlake.com");
return (
<iframe
style={{ borderRadius: 12 }}
src={convertedUrl}
width="100%"
height="360"
height="380"
frameBorder="0"
allow="autoplay; clipboard-write; encrypted-media; fullscreen; picture-in-picture"
loading="lazy"></iframe>
);
};