Permalink
Browse files

Merge branch 'MDL-57546-master' of git://github.com/andrewnicols/moodle

  • Loading branch information...
dmonllao committed Jul 31, 2017
2 parents 707f9be + 2cad0cd commit 549e57410f6ec1533285cb555fa8c614ee747a92
Showing with 4 additions and 1 deletion.
  1. +1 −1 media/player/youtube/classes/plugin.php
  2. +3 −0 media/player/youtube/tests/player_test.php
@@ -159,7 +159,7 @@ protected function get_regex() {
$shortlink = '((youtu|y2u)\.be/)';
// Initial part of link.
$start = '~^https?://(www\.)?(' . $link . '|' . $shortlink . ')';
$start = '~^https?://((www|m)\.)?(' . $link . '|' . $shortlink . ')';
// Middle bit: Video key value.
$middle = '([a-z0-9\-_]+)';
return $start . $middle . core_media_player_external::END_LINK_REGEX_PART;
@@ -70,6 +70,9 @@ public function test_supported() {
$url = new moodle_url('http://www.youtube.com/v/vyrwMmsufJc');
$t = $manager->embed_url($url);
$this->assertContains('</iframe>', $t);
$url = new moodle_url('http://m.youtube.com/watch?v=vyrwMmsufJc');
$t = $manager->embed_url($url);
$this->assertContains('</iframe>', $t);
// Format: youtube video within playlist.
$url = new moodle_url('https://www.youtube.com/watch?v=dv2f_xfmbD8&index=4&list=PLxcO_MFWQBDcyn9xpbmx601YSDlDcTcr0');

0 comments on commit 549e574

Please sign in to comment.