Skip to content
Snippets Groups Projects
Commit bfdfadbb authored by Kevin Paxman's avatar Kevin Paxman
Browse files

ISTWCMS-7251: add support for YouTube shorts

parent 2f14b737
No related branches found
No related tags found
1 merge request!259ISTWCMS-7251: provide the media item title to the theming
......@@ -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')) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment