Problem/Motivation
When trying to embed a YouTube Shorts video, this error is received:
Unable to handle the provided embed string or URL.
Steps to reproduce
With a WYSIYWG + Media implementation, try to embed a YouTube Shorts video URL like https://youtube.com/shorts/abc123
Proposed resolution
Add this pattern to MediaInternetYouTubeHandler.inc:
'@youtube\.com/shorts/([^"#\&\? ]+)@i',
Remaining tasks
Create a patch
User interface changes
None
API changes
None
Data model changes
None
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | 3293467-9.patch | 547 bytes | joseph.olstad |
| #3 | 3293467-3.patch | 559 bytes | immaculatexavier |
Comments
Comment #2
joseph.olstadThanks for reporting, sounds like a good idea to support this in the next release. I will review contributed patches or merge requests. If you have a patch for this I will review. If not, let us know if you have tried making this work or not and how far you got.
Comment #3
immaculatexavier commentedAttached patch in accordance with the proposed resolution.
Comment #4
tyler.frankenstein commented@immaculatexavier, thank you for the patch in #3. It matches the proposed resolution and applies cleanly.
Comment #5
cyu commentedThis patch is adding the pattern to $list_patterns which wasn't working for me. Adding the pattern to $patterns instead does work for me.
Comment #6
gaurav-mathur commentedComment #7
gaurav-mathur commentedHi according to #5 i have Re-roll the patch.
Kindly review patch
Thank you.
Comment #9
joseph.olstad@gaurav-mathur, this is more like it , see my patch instead. Putting the pattern to the $patterns array instead of list_patterns however I haven't tested this.
Comment #10
joseph.olstadComment #11
joseph.olstadAsking for review assistance, please explain why the first patch changed list_patterns and why someone requested the change to patterns?
Manual test results? I haven't had a chance to try this patch yet.
why add to one or the other, does adding to both work? which one does what?
Comment #12
joseph.olstadok patch 9 appears to be passing automated tests so far, just waiting for some real world testing, anyone have any luck with patch 9?
Comment #13
cyu commentedThe two entries in $list_patterns are for playlists, and the entries in $patterns are for individual videos, so that should be why the original patch in #3 wasn't working for me but the patch in #9 does work for me. I didn't see anything special when making a playlist of shorts, so I think that would fall into one of the existing $list_patterns.
This has been in use on a production site for about a month now without issue.
Comment #14
joseph.olstad@cYu, ok thanks for reviewing patch #9, I will jam this in
Comment #16
joseph.olstadComment #17
joseph.olstadhttps://www.drupal.org/project/media_youtube/releases/7.x-3.12