Skip to content

Commit

Permalink
Merge pull request #17099 from ckeditor/ck/17090
Browse files Browse the repository at this point in the history
Feature (media-embed): It's now possible to embed YouTube shorts. Closes #17090
  • Loading branch information
Mati365 authored Sep 17, 2024
2 parents a488263 + bba1f7f commit 2b74a8a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/ckeditor5-media-embed/src/mediaembedediting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ export default class MediaEmbedEditing extends Plugin {
name: 'youtube',
url: [
/^(?:m\.)?youtube\.com\/watch\?v=([\w-]+)(?:&t=(\d+))?/,
/^(?:m\.)?youtube\.com\/shorts\/([\w-]+)(?:\?t=(\d+))?/,
/^(?:m\.)?youtube\.com\/v\/([\w-]+)(?:\?t=(\d+))?/,
/^youtube\.com\/embed\/([\w-]+)(?:\?start=(\d+))?/,
/^youtu\.be\/([\w-]+)(?:\?t=(\d+))?/
Expand Down
4 changes: 4 additions & 0 deletions packages/ckeditor5-media-embed/tests/mediaembedediting.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,10 @@ describe( 'MediaEmbedEditing', () => {

it( 'upcasts the URL (youtube)', () => {
testMediaUpcast( [
'https://www.youtube.com/shorts/foo',
'www.youtube.com/shorts/foo',
'youtube.com/shorts/foo',

'https://www.youtube.com/watch?v=foo',
'www.youtube.com/watch?v=foo',
'youtube.com/watch?v=foo',
Expand Down

0 comments on commit 2b74a8a

Please sign in to comment.