mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-10-02 17:11:15 +02:00
add youtube music embeds
This commit is contained in:
@@ -28,8 +28,7 @@ const embeds: {
|
|||||||
},
|
},
|
||||||
// Youtube Video
|
// Youtube Video
|
||||||
{
|
{
|
||||||
regexp:
|
regexp: /https?:\/\/((?:www|m)\.)?((?:youtube\.com|youtu\.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/im,
|
||||||
/((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu\.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/im,
|
|
||||||
render: (match) => (
|
render: (match) => (
|
||||||
<AspectRatio ratio={16 / 10} maxWidth="30rem">
|
<AspectRatio ratio={16 / 10} maxWidth="30rem">
|
||||||
<iframe
|
<iframe
|
||||||
@@ -43,6 +42,20 @@ const embeds: {
|
|||||||
</AspectRatio>
|
</AspectRatio>
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
|
// Youtube Music
|
||||||
|
{
|
||||||
|
regexp: /https?:\/\/music\.youtube\.com\/watch\?v=(\w+)[^\s]+/,
|
||||||
|
render: (match) => (
|
||||||
|
<iframe
|
||||||
|
width="480"
|
||||||
|
height="360"
|
||||||
|
src={`https://youtube.com/embed/${match[1]}`}
|
||||||
|
frameBorder="0"
|
||||||
|
allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"
|
||||||
|
allowFullScreen
|
||||||
|
></iframe>
|
||||||
|
),
|
||||||
|
},
|
||||||
// Tidal
|
// Tidal
|
||||||
{
|
{
|
||||||
regexp: /https?:\/\/tidal\.com(\/browse)?\/track\/(\d+)/im,
|
regexp: /https?:\/\/tidal\.com(\/browse)?\/track\/(\d+)/im,
|
||||||
|
Reference in New Issue
Block a user