Skip to content
Snippets Groups Projects
Unverified Commit 316834b0 authored by Tobias Reischmann's avatar Tobias Reischmann
Browse files

The repository directly delivers the player url. No need to rebuild it.

parent 35c3e29d
No related branches found
No related tags found
No related merge requests found
...@@ -84,18 +84,15 @@ class filter_opencast extends moodle_text_filter { ...@@ -84,18 +84,15 @@ class filter_opencast extends moodle_text_filter {
continue; continue;
} }
if (strpos($baseurl, 'http') !== 0) { // Extract url.
$baseurl = 'http://' . $baseurl; preg_match_all('/<source[^>]+src=([\'"])(?<src>.+?)\1[^>]*>/i', $match, $result);
}
// Extract id.
$id = substr($match, strpos($match, 'api/') + 4, 36);
// Create link to video.
$playerurl = get_config('filter_opencast', 'playerurl');
// Change url for loading the (Paella) Player. // Change url for loading the (Paella) Player.
$link = $baseurl . $playerurl .'?id=' . $id; $link = $result['src'][0];
if (strpos($link, 'http') !== 0) {
$link = 'http://' . $link;
}
// Create source with embedded mode. // Create source with embedded mode.
$src = $link; $src = $link;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment