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;});";
118 $toolbar->addComponent($back);
119 $toolbar->addComponent($next);
124 $toolbar->addSeparator();
126 $autoplay_on = $s->create();
127 $autoplay_off = $s->create();
128 $button =
$factory->button()->toggle($lng->txt(
"mcst_autoplay"), $autoplay_on, $autoplay_off, $autoplay);
129 $toolbar->addComponent($button);
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(
143 $lng->txt(
"mcst_webfeed"),
145 )->withOpenInNewViewport(
true)
147 $toolbar->addComponent(
$f->dropdown()->standard($actions));
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) {
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>',
231 $tpl->setVariable(
"PANEL", $panel_html);
240 "$(\"#$id\").click(function() { il.VideoPlaylist.previousItems('mcst_playlist'); return false;});";
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 !=
"") {
303 $tpl->setCurrentBlock(
"with_side_column");
304 $tpl->setVariable(
"SIDE", $side_column);
306 $tpl->setCurrentBlock(
"video_only");
309 $tpl->parseCurrentBlock();
315 if (is_object($this->tpl)) {
if(isset($_FILES['img_file']) &&is_array($_FILES['img_file'])) $panel
withOnLoadCode(Closure $binder)
static _lookupReadEvents($obj_id, $usr_id=null)
Reads all read events which occured on the object.
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins