diff --git a/lib/medialib.php b/lib/medialib.php index 57a9e902bb0..229006083f4 100644 --- a/lib/medialib.php +++ b/lib/medialib.php @@ -493,7 +493,7 @@ class core_media_player_vimeo extends core_media_player_external { $output = << - OET; @@ -503,7 +503,7 @@ OET; protected function get_regex() { // Initial part of link. - $start = '~^http://vimeo\.com/'; + $start = '~^https?://vimeo\.com/'; // Middle bit: either watch?v= or v/. $middle = '([0-9]+)'; return $start . $middle . core_media_player_external::END_LINK_REGEX_PART; @@ -541,8 +541,9 @@ class core_media_player_youtube extends core_media_player_external { if (empty($CFG->xmlstrictheaders)) { return << + + + OET; } @@ -551,7 +552,7 @@ OET; $output = << + data="https://$site/v/$videoid&fs=1&rel=0" width="$width" height="$height"> @@ -564,7 +565,7 @@ OET; protected function get_regex() { // Initial part of link. - $start = '~^(https?://www\.youtube(-nocookie)?\.com)/'; + $start = '~^https?://(www\.youtube(-nocookie)?\.com)/'; // Middle bit: either watch?v= or v/. $middle = '(?:watch\?v=|v/)([a-z0-9\-_]+)'; return $start . $middle . core_media_player_external::END_LINK_REGEX_PART; @@ -607,26 +608,16 @@ class core_media_player_youtube_playlist extends core_media_player_external { self::pick_video_size($width, $height); - // TODO: iframe HTML 5 video not implemented and object does not work - // on iOS devices. - $fallback = core_media_player::PLACEHOLDER; - $output = << - - - - -$fallback + OET; - - return $output; } protected function get_regex() { // Initial part of link. - $start = '~^(https?://www\.youtube(-nocookie)?\.com)/'; + $start = '~^https?://(www\.youtube(-nocookie)?\.com)/'; // Middle bit: either view_play_list?p= or p/ (doesn't work on youtube) or playlist?list=. $middle = '(?:view_play_list\?p=|p/|playlist\?list=)([a-z0-9\-_]+)'; return $start . $middle . core_media_player_external::END_LINK_REGEX_PART;