Skip to content

Commit

Permalink
Merge pull request #653 from frf-nn/pull-request-1
Browse files Browse the repository at this point in the history
mol_embed_youtube add support for "shorts" urls
  • Loading branch information
nin-jin authored Dec 21, 2023
2 parents 60d560e + bd3bca1 commit 463c543
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion embed/youtube/youtube.view.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ namespace $.$$ {

@ $mol_mem
video_id() {
return this.uri().match( /^https\:\/\/www\.youtube\.com\/(?:embed\/|watch\?v=)([^\/&?#]+)/ )?.[1]
return this.uri().match( /^https\:\/\/www\.youtube\.com\/(?:embed\/|shorts\/|watch\?v=)([^\/&?#]+)/ )?.[1]
?? this.uri().match( /^https\:\/\/youtu\.be\/([^\/&?#]+)/ )?.[1]
?? 'about:blank'
}
Expand Down

0 comments on commit 463c543

Please sign in to comment.