diff --git a/controllers/admin.php b/controllers/admin.php index 9aa80d3..224114c 100644 --- a/controllers/admin.php +++ b/controllers/admin.php @@ -98,10 +98,10 @@ public function admin_change_playerdata_action() if (!$error) { $livestream_config['loginname'] = $loginname; $livestream_config['password'] = $password; - $livestream_config['sender_url'] = trim(strtolower($sender_url)); - $livestream_config['player_url'] = trim(strtolower($player_url)); + $livestream_config['sender_url'] = $sender_url; + $livestream_config['player_url'] = $player_url; if ($use_opencast && $this->plugin->checkOpenCast()) { - $livestream_config['oc_player_url'] = trim(strtolower($oc_player_url)); + $livestream_config['oc_player_url'] = $oc_player_url; $livestream_config['use_opencast'] = true; } else { $livestream_config['use_opencast'] = false; diff --git a/controllers/player.php b/controllers/player.php index 83af2bb..750ed23 100644 --- a/controllers/player.php +++ b/controllers/player.php @@ -69,8 +69,8 @@ public function teacher_action() if ($mode == MODE_DEFAULT) { $this->player_username = $livestream_config['loginname']; $this->player_password = $livestream_config['password']; - $this->sender_url = str_replace(URLPLACEHOLDER, Context::getId(), trim(strtolower($livestream_config['sender_url']))); - $this->player_url = str_replace(URLPLACEHOLDER, Context::getId(), trim(strtolower($livestream_config['player_url']))); + $this->sender_url = str_replace(URLPLACEHOLDER, Context::getId(), $this->lowercaseURLProtocol($livestream_config['sender_url'])); + $this->player_url = str_replace(URLPLACEHOLDER, Context::getId(), $this->lowercaseURLProtocol($livestream_config['player_url'])); $this->countdown_activated = intval($livestream->countdown_activated); @@ -168,7 +168,7 @@ public function student_action() if ($mode == MODE_DEFAULT) { $this->show_player = true; - $this->player_url = str_replace(URLPLACEHOLDER, Context::getId(), trim(strtolower($livestream_config['player_url']))); + $this->player_url = str_replace(URLPLACEHOLDER, Context::getId(), $this->lowercaseURLProtocol($livestream_config['player_url'])); $this->mode = $mode; // countdown @@ -208,7 +208,7 @@ public function student_action() $this->show_player = true; $refresh_in_seconds = $todays_session[LIVE]['refresh_seconds']; $this->termin = $todays_session[LIVE]['termin']; - $this->player_url= str_replace(URLPLACEHOLDER, $todays_session[LIVE]['capture_agent'], trim(strtolower($livestream_config['oc_player_url']))); + $this->player_url = str_replace(URLPLACEHOLDER, $todays_session[LIVE]['capture_agent'], $this->lowercaseURLProtocol($livestream_config['oc_player_url'])); } if (isset($todays_session[PENDING])) { @@ -539,4 +539,13 @@ private function CheckSessionProgress($livestream) } return $session_info; } + + private function lowercaseURLProtocol($url) { + $url_explode = explode('://', $url); + if ($url_explode) { + $url = strtolower($url_explode[0]) . '://' . $url_explode[1]; + } + return $url; + } } +