From be515f5150f20c773371f680efad58f2d0fcaaf0 Mon Sep 17 00:00:00 2001 From: Benjamin Peter Date: Sat, 9 Dec 2017 23:44:47 +0100 Subject: Added multple translation tracks with configurable endpoints and labels --- model/Stream.php | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'model/Stream.php') diff --git a/model/Stream.php b/model/Stream.php index daed17f..a4dcf72 100644 --- a/model/Stream.php +++ b/model/Stream.php @@ -2,11 +2,12 @@ class Stream { - public function __construct(Room $room, $selection, $language) + public function __construct(Room $room, $selection, $language, $translation_label = null) { $this->room = $room; $this->selection = $selection; $this->language = $language; + $this->translation_label = (empty($translation_label)) ? $language : $translation_label; } public function getRoom() @@ -24,9 +25,14 @@ class Stream return $this->language; } + public function getTranslationLabel() + { + return $this->translation_label; + } + public function isTranslated() { - return $this->getLanguage() == 'translated'; + return !empty($this->getLanguage()) && $this->getLanguage() !== 'native'; } public function getVideoSize() @@ -98,7 +104,7 @@ class Stream } if($this->isTranslated()) - $display .= ' (Translation)'; + $display .= ' ('. $this->getTranslationLabel() .')'; return $display; } -- cgit v1.2.3