35 protected \ilGlobalTemplateInterface
$tpl;
36 protected \ILIAS\DI\UIServices
$ui;
37 protected \ilLanguage
$lng;
51 $this->
ui = $DIC->ui();
53 $this->
lng = $DIC->language();
54 $this->media_cast = $obj;
57 $this->
user = $DIC->user();
58 $this->main_tpl =
$DIC->ui()->mainTemplate();
59 $this->
toolbar = $DIC->toolbar();
77 if (count($this->video_sequence->getVideos()) == 0) {
82 $widget->setVideo($this->video_sequence->getFirst());
83 return $widget->render();
91 $video_cnt = count($this->video_sequence->getVideos());
98 $renderer = $this->
ui->renderer();
100 if ($video_cnt > 1) {
101 $back =
$factory->button()->standard(
102 "<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>",
105 ->withOnLoadCode(
function (
$id) {
107 "$(\"#$id\").click(function() { il.VideoWidget.previous(\"" . $this->video_wrapper_id .
"\"); return false;});";
109 $next =
$factory->button()->standard(
110 "<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>",
113 ->withOnLoadCode(
function (
$id) {
115 "$(\"#$id\").click(function() { il.VideoWidget.next(\"" . $this->video_wrapper_id .
"\"); return false;});";
126 $autoplay_on = $s->create();
127 $autoplay_off = $s->create();
128 $button =
$factory->button()->toggle(
$lng->
txt(
"mcst_autoplay"), $autoplay_on, $autoplay_off, $autoplay);
130 $this->main_tpl->addOnLoadCode(
"
131 $(document).on('" . $autoplay_on .
"', function (event, signalData) {
132 il.VideoPlaylist.autoplay('mcst_playlist', true);
134 $(document).on('" . $autoplay_off .
"', function (event, signalData) {
135 il.VideoPlaylist.autoplay('mcst_playlist', false);
139 if ($video_cnt > 0 && $this->rss_link !==
"") {
140 $f = $this->
ui->factory();
142 $f->link()->standard(
145 )->withOpenInNewViewport(
true)
153 $video_cnt = count($this->video_sequence->getVideos());
154 if ($video_cnt <= 1) {
157 $autoplay = ($this->
user->existsPref(
"mcst_autoplay"))
158 ? (
bool) $this->
user->getPref(
"mcst_autoplay")
173 $tpl = new \ilTemplate(
"tpl.video_cast_side.html",
true,
true,
"Modules/MediaCast/Presentation");
176 $renderer = $this->
ui->renderer();
184 foreach ($this->video_sequence->getVideos() as $video) {
187 $video->getPreviewPic(),
188 "il.VideoPlaylist.toggleItem('mcst_playlist', '" . $video->getId() .
"');",
189 $video->getPlayingTime()
194 if (count($re) > 0) {
195 if ($re[0][
"read_count"] > 0) {
200 $b =
$factory->button()->shy($video->getTitle(),
"")->withOnLoadCode(
function (
$id) use ($video) {
202 "$(\"#$id\").click(function() { il.VideoPlaylist.toggleItem('mcst_playlist', '" . $video->getId() .
"'); return false;});";
206 "id" => $video->getId(),
207 "resource" => $video->getResource(),
209 "preview_pic" => $video->getPreviewPic(),
210 "title" => $video->getTitle(),
211 "linked_title" => $renderer->renderAsync(
$b),
212 "mime" => $video->getMime(),
213 "poster" => $video->getPreviewPic(),
214 "description" => nl2br($video->getDescription()),
215 "completed" => $completed,
216 "duration" => $video->getDuration()
224 $panel_html = $renderer->render(
$panel);
225 $panel_html = str_replace(
226 '<div class="panel-body">',
227 '<div class="panel-body"><div id="mcst_playlist"></div>',
237 $factory->button()->standard(
$lng->
txt(
"mcst_prev_items"),
"")->withOnLoadCode(
240 "$(\"#$id\").click(function() { il.VideoPlaylist.previousItems('mcst_playlist'); return false;});";
248 $factory->button()->standard(
$lng->
txt(
"mcst_next_items"),
"")->withOnLoadCode(
251 "$(\"#$id\").click(function() { il.VideoPlaylist.nextItems('mcst_playlist'); return false;});";
257 $item_tpl = new \ilTemplate(
"tpl.playlist_item.html",
true,
true,
"Modules/MediaCast/Video");
258 $item_tpl->setVariable(
"TITLE",
" ");
259 $item_content = str_replace(
"\n",
"", $item_tpl->get());
261 $item =
$factory->item()->standard(
"#video-title#")
263 $factory->image()->responsive(
"#img-src#",
"#img-alt#")
266 $item_content = $renderer->render($item);
267 $item_content = str_replace(
"\n",
"", $item_content);
269 $init_videos = $this->media_cast->getNumberInitialVideos() > 0
270 ? $this->media_cast->getNumberInitialVideos()
273 $this->tpl->addOnLoadCode(
274 "il.VideoPlaylist.init('mcst_playlist', 'mcst_video', " . json_encode(
276 ) .
", '$item_content', " . ($autoplay ?
"true" :
"false") .
", " .
277 (
int) $init_videos .
", '" . $this->completed_callback .
"', '" . $this->autoplay_callback .
"', " . ((
int) $mcst_settings->getVideoCompletionThreshold()) .
");"
280 if (count($items) === 1) {
298 $tpl = new \ilTemplate(
"tpl.video_cast_layout.html",
true,
true,
"Modules/MediaCast/Presentation");
302 if ($side_column !=
"") {
309 $tpl->parseCurrentBlock();
315 if (is_object($this->tpl)) {
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
static return function(ContainerConfigurator $containerConfigurator)
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setCurrentBlock(string $part=self::DEFAULT_BLOCK)
Sets the template to the given block.
setVariable(string $variable, $value='')
Sets the given variable to the given value.
get(string $part=self::DEFAULT_BLOCK)
Renders the given block and returns the html string.