ILIAS  release_8 Revision v8.19
All Data Structures Namespaces Files Functions Variables Modules Pages
ILIAS\MediaCast\Video\VideoWidgetGUI Class Reference
+ Collaboration diagram for ILIAS\MediaCast\Video\VideoWidgetGUI:

Public Member Functions

 __construct (\ilGlobalTemplateInterface $main_tpl, string $dom_wrapper_id)
 
 setVideo (?VideoItem $a_val=null)
 
 getVideo ()
 
 render ()
 

Protected Attributes

string $dom_wrapper_id
 
ILIAS DI UIServices $ui
 
ilLanguage $lng
 
VideoItem $video = null
 
ilGlobalTemplateInterface $main_tpl
 

Detailed Description

Author
Alexander Killing killi.nosp@m.ng@l.nosp@m.eifos.nosp@m..de

Definition at line 24 of file class.VideoWidgetGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ILIAS\MediaCast\Video\VideoWidgetGUI::__construct ( \ilGlobalTemplateInterface  $main_tpl,
string  $dom_wrapper_id 
)

Definition at line 32 of file class.VideoWidgetGUI.php.

References $DIC, ILIAS\MediaCast\Video\VideoWidgetGUI\$dom_wrapper_id, ILIAS\MediaCast\Video\VideoWidgetGUI\$main_tpl, ilGlobalTemplateInterface\addJavaScript(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

35  {
36  global $DIC;
37 
38  $main_tpl->addJavaScript("Modules/MediaCast/Video/js/video_widget.js");
39  $this->main_tpl = $main_tpl;
40  $this->dom_wrapper_id = $dom_wrapper_id;
41  $this->ui = $DIC->ui();
42  $this->lng = $DIC->language();
43  }
global $DIC
Definition: feed.php:28
addJavaScript(string $a_js_file, bool $a_add_version_parameter=true, int $a_batch=2)
Add a javascript file that should be included in the header.
+ Here is the call graph for this function:

Member Function Documentation

◆ getVideo()

ILIAS\MediaCast\Video\VideoWidgetGUI::getVideo ( )

Definition at line 50 of file class.VideoWidgetGUI.php.

References ILIAS\MediaCast\Video\VideoWidgetGUI\$video.

Referenced by ILIAS\MediaCast\Video\VideoWidgetGUI\render().

50  : ?VideoItem
51  {
52  return $this->video;
53  }
+ Here is the caller graph for this function:

◆ render()

ILIAS\MediaCast\Video\VideoWidgetGUI::render ( )
Exceptions

Definition at line 58 of file class.VideoWidgetGUI.php.

References Vendor\Package\$f, $tpl, ILIAS\MediaCast\Video\VideoWidgetGUI\$ui, and ILIAS\MediaCast\Video\VideoWidgetGUI\getVideo().

58  : string
59  {
60  $ui = $this->ui;
61  $video = $ui->factory()->player()->video("")->withPoster("");
62  $video_tpl_html = $ui->renderer()->render($video);
63  $video_tpl_html = str_replace("\n", "", $video_tpl_html);
64 
65  $tpl = new \ilTemplate("tpl.wrapper.html", true, true, "Modules/MediaCast/Video");
66  $f = $ui->factory();
67 
68  $tpl->setVariable("ID", $this->dom_wrapper_id);
69  $this->main_tpl->addOnLoadCode(
70  "il.VideoWidget.init('" . $this->dom_wrapper_id . "', '" . $video_tpl_html . "');"
71  );
72 
73  if (!is_null($this->getVideo())) {
74  $this->main_tpl->addOnLoadCode(
75  "il.VideoWidget.loadFile('" .
76  $this->dom_wrapper_id . "', '" .
77  $this->getVideo()->getResource() . "', false);"
78  );
79  }
80 
81  $item = $f->item()->standard('#title#')
82  ->withDescription('#description#');
83  $item_html = $ui->renderer()->render($item);
84  $item_html = str_replace(
85  "#title#",
86  '<span data-elementtype="title"></span>',
87  $item_html
88  );
89  $item_html = str_replace(
90  "#description#",
91  '<span data-elementtype="description-wrapper"><span data-elementtype="description"></span></span>',
92  $item_html
93  );
94  $tpl->setVariable("ITEM", $item_html);
95 
96 
97  /*
98  $back = $f->button()->standard("<span class=\"glyphicon glyphicon-chevron-left \" aria-hidden=\"true\"></span>", "")
99  ->withOnLoadCode(function ($id) {
100  return
101  "$(\"#$id\").click(function() { il.VideoWidget.previous(\"".$this->dom_wrapper_id."\"); return false;});";
102  });
103  $next = $f->button()->standard("<span class=\"glyphicon glyphicon-chevron-right \" aria-hidden=\"true\"></span>", "")
104  ->withOnLoadCode(function ($id) {
105  return
106  "$(\"#$id\").click(function() { il.VideoWidget.next(\"".$this->dom_wrapper_id."\"); return false;});";
107  });*/
108 
109 
110  /*
111  $description_link = $f->button()->shy($this->lng->txt("mcst_show_description"), "")->withOnLoadCode(function ($id) {
112  return
113  "$(\"#$id\").click(function() { $(document).find(\"[data-elementtype='description']\").removeClass('ilNoDisplay'); $(document).find(\"[data-elementtype='description-trigger']\").addClass('ilNoDisplay'); return false;});";
114  });
115  $tpl->setVariable("DESCRIPTION_LINK", $ui->renderer()->render($description_link));*/
116 
117  //$tpl->setVariable("VIEWCONTROL", $ui->renderer()->render([$back,$next]));
118 
119  /*
120  $tpl->setCurrentBlock("autoplay");
121  $tpl->setVariable("TXT_AUTOPLAY",
122  $this->lng->txt("mcst_autoplay"));
123  $tpl->parseCurrentBlock();*/
124 
125  return $tpl->get();
126  }
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41
+ Here is the call graph for this function:

◆ setVideo()

ILIAS\MediaCast\Video\VideoWidgetGUI::setVideo ( ?VideoItem  $a_val = null)

Definition at line 45 of file class.VideoWidgetGUI.php.

45  : void
46  {
47  $this->video = $a_val;
48  }

Field Documentation

◆ $dom_wrapper_id

string ILIAS\MediaCast\Video\VideoWidgetGUI::$dom_wrapper_id
protected

◆ $lng

ilLanguage ILIAS\MediaCast\Video\VideoWidgetGUI::$lng
protected

Definition at line 28 of file class.VideoWidgetGUI.php.

◆ $main_tpl

ilGlobalTemplateInterface ILIAS\MediaCast\Video\VideoWidgetGUI::$main_tpl
protected

◆ $ui

ILIAS DI UIServices ILIAS\MediaCast\Video\VideoWidgetGUI::$ui
protected

◆ $video

VideoItem ILIAS\MediaCast\Video\VideoWidgetGUI::$video = null
protected

The documentation for this class was generated from the following file: