diff --git a/src/EventSubscriber/UwCblRemoteVideoEventSubscriber.php b/src/EventSubscriber/UwCblRemoteVideoEventSubscriber.php index c535df1937ce0ab3a9d1ae5ea3cf43a1761c5c9d..96132369542fe5e74562ba807c504fe8c7dda6ae 100644 --- a/src/EventSubscriber/UwCblRemoteVideoEventSubscriber.php +++ b/src/EventSubscriber/UwCblRemoteVideoEventSubscriber.php @@ -73,11 +73,17 @@ class UwCblRemoteVideoEventSubscriber extends UwCblBase implements EventSubscrib $remote_video['view']['type'] = 'YouTube'; } // Check for YouTube playlist. - elseif (preg_match($pattern = '/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/(playlist\?list=)([a-zA-Z0-9_-]+)$/', $remote_video['view']['url'])) { + elseif (preg_match('/^(https?:\/\/)?(www\.)?(youtube\.com|youtu\.?be)\/(playlist\?list=)([a-zA-Z0-9_-]+)$/', $remote_video['view']['url'])) { // Set the type of video to YouTube playlist. $remote_video['view']['type'] = 'YouTube playlist'; } + // Check for YouTube short. + elseif (preg_match('/https?:\/\/(www\.)?youtube\.com\/shorts\/[a-zA-Z0-9_-]+/', $remote_video['view']['url'])) { + + // Set the type of video to YouTube short. + $remote_video['view']['type'] = 'YouTube short'; + } // Check for Vimeo. elseif (strrpos($remote_video['view']['url'], 'vimeo')) {