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

Comments

tyler.frankenstein created an issue. See original summary.

joseph.olstad’s picture

Thanks 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.

immaculatexavier’s picture

Status: Active » Needs review
StatusFileSize
new559 bytes

Attached patch in accordance with the proposed resolution.

tyler.frankenstein’s picture

Status: Needs review » Reviewed & tested by the community

@immaculatexavier, thank you for the patch in #3. It matches the proposed resolution and applies cleanly.

cyu’s picture

Status: Reviewed & tested by the community » Needs review

This patch is adding the pattern to $list_patterns which wasn't working for me. Adding the pattern to $patterns instead does work for me.

gaurav-mathur’s picture

Assigned: Unassigned » gaurav-mathur
gaurav-mathur’s picture

Assigned: gaurav-mathur » Unassigned
StatusFileSize
new627 bytes
new626 bytes

Hi according to #5 i have Re-roll the patch.
Kindly review patch
Thank you.

Status: Needs review » Needs work

The last submitted patch, 7: 3293467-7.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

joseph.olstad’s picture

StatusFileSize
new547 bytes

@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.

joseph.olstad’s picture

Status: Needs work » Needs review
joseph.olstad’s picture

Asking 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?

joseph.olstad’s picture

ok patch 9 appears to be passing automated tests so far, just waiting for some real world testing, anyone have any luck with patch 9?

cyu’s picture

Status: Needs review » Reviewed & tested by the community

why add to one or the other, does adding to both work? which one does what?

The 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.

joseph.olstad’s picture

@cYu, ok thanks for reviewing patch #9, I will jam this in

  • joseph.olstad committed ba52b409 on 7.x-3.x
    Issue #3293467 by gaurav-mathur, joseph.olstad, immaculatexavier:...
joseph.olstad’s picture

Status: Reviewed & tested by the community » Fixed
joseph.olstad’s picture

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.