mirror of
https://github.com/hzrd149/nostrudel.git
synced 2025-03-17 21:31:43 +01:00
add youtube music embeds
This commit is contained in:
parent
2822f992fb
commit
07f95cead0
@ -28,8 +28,7 @@ const embeds: {
|
||||
},
|
||||
// Youtube Video
|
||||
{
|
||||
regexp:
|
||||
/((?:https?:)?\/\/)?((?:www|m)\.)?((?:youtube\.com|youtu\.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/im,
|
||||
regexp: /https?:\/\/((?:www|m)\.)?((?:youtube\.com|youtu\.be))(\/(?:[\w\-]+\?v=|embed\/|v\/)?)([\w\-]+)(\S+)?/im,
|
||||
render: (match) => (
|
||||
<AspectRatio ratio={16 / 10} maxWidth="30rem">
|
||||
<iframe
|
||||
@ -43,6 +42,20 @@ const embeds: {
|
||||
</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
|
||||
{
|
||||
regexp: /https?:\/\/tidal\.com(\/browse)?\/track\/(\d+)/im,
|
||||
|
Loading…
x
Reference in New Issue
Block a user