Merge pull request #27 from v0l/youtube-m
fix: support m.youtube.com subdomain links
This commit is contained in:
commit
eabc3c8307
@ -61,4 +61,4 @@ export const InvoiceRegex = /(lnbc\w+)/i;
|
||||
/**
|
||||
* YouTube URL regex
|
||||
*/
|
||||
export const YoutubeUrlRegex = /^(?:https?:\/\/)?(?:www\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
||||
export const YoutubeUrlRegex = /^(?:https?:\/\/)?(?:www|m\.)?(?:youtu\.be\/|youtube\.com\/(?:embed\/|v\/|watch\?v=|watch\?.+&v=))((\w|-){11})(?:\S+)?$/
|
||||
|
@ -35,6 +35,7 @@ function transformHttpLink(a) {
|
||||
<>
|
||||
<br />
|
||||
<iframe
|
||||
className="w-max"
|
||||
src={`https://www.youtube.com/embed/${youtubeId}`}
|
||||
title="YouTube video player"
|
||||
frameBorder="0"
|
||||
|
@ -32,12 +32,15 @@
|
||||
.note > .body img, .note > .body video, .note > .body iframe {
|
||||
max-width: 100%;
|
||||
max-height: 500px;
|
||||
margin: 10px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
margin: 10px auto;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.note > .body iframe, note > .body video {
|
||||
width: -webkit-fill-available;
|
||||
aspect-ratio: 16 / 9;
|
||||
}
|
||||
|
||||
.note > .header img:hover, .note > .header .name > .reply:hover, .note .body:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user