aboutsummaryrefslogtreecommitdiff
path: root/model/Stream.php
diff options
context:
space:
mode:
authorBenjamin Peter2017-12-09 23:44:47 +0100
committerdedeibel2017-12-10 18:25:21 +0100
commitbe515f5150f20c773371f680efad58f2d0fcaaf0 (patch)
tree2035fa3a60399686b6c5f6e381124be68c5c667e /model/Stream.php
parent65397e5734b1439df4d68be40ffe994f26e551ec (diff)
Added multple translation tracks with configurable endpoints and labels
Diffstat (limited to 'model/Stream.php')
-rw-r--r--model/Stream.php12
1 files changed, 9 insertions, 3 deletions
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;
}