From b57ba18e38feaedad309ffb1156d24c395ed157c Mon Sep 17 00:00:00 2001 From: Nick Clemens Date: Wed, 31 Aug 2016 17:37:56 +0000 Subject: [PATCH] Bug 17231 - HTML5MediaYouTube should recognize youtu.be links from youtube as well at the full links To test: Enable HTML5MediaYouTube and ensure WWW::YouTube::Download is installed Add an 856$u to a record like: https://www.youtube.com/watch?v=tu0qtEwb9gE Verify you can see the embedded player Use the youtube shortened like (from the share button) like: https://youtu.be/tu0qtEwb9gE Verify you can see the embedded player --- C4/HTML5Media.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C4/HTML5Media.pm b/C4/HTML5Media.pm index b438933..7594024 100644 --- a/C4/HTML5Media.pm +++ b/C4/HTML5Media.pm @@ -98,7 +98,7 @@ sub gethtml5media { # src if ( $HTML5Media_field->subfield('u') ) { $HTML5Media{srcblock} = $HTML5Media_field->subfield('u'); - if (grep /youtube/, $HTML5Media_field->subfield('u') ) { # TODO is there an official YT URL shortener? Can we use that too? + if (grep 'youtube|/youtu.be/', $HTML5Media_field->subfield('u') ) { if ($HTML5MediaYouTube == 1) { require WWW::YouTube::Download; import WWW::YouTube::Download qw(playback_url); -- 2.1.4