Skip to content

Commit

Permalink
Merge branch 'MDL-57546-master' of git://github.com/andrewnicols/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
David Monllao committed Jul 31, 2017
2 parents 707f9be + 2cad0cd commit 549e574
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion media/player/youtube/classes/plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
3 changes: 3 additions & 0 deletions media/player/youtube/tests/player_test.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down

0 comments on commit 549e574

Please sign in to comment.