ILIAS  trunk Revision v11.0_alpha-2662-g519ff7d528f
ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI Class Reference
+ Collaboration diagram for ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\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\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::__construct ( \ilGlobalTemplateInterface  $main_tpl,
string  $dom_wrapper_id 
)

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

References $DIC, ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI\$dom_wrapper_id, ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI\$main_tpl, ILIAS\UICore\GlobalTemplate\addJavaScript(), ILIAS\Repository\lng(), and ILIAS\Repository\ui().

35  {
36  global $DIC;
37  $debug = false;
38  if (!$debug) {
39  $main_tpl->addJavaScript("assets/js/video_widget.js");
40  } else {
41  $main_tpl->addJavaScript("../components/ILIAS/MediaCast/resources/video_widget.js");
42  }
43 
44  $this->main_tpl = $main_tpl;
45  $this->dom_wrapper_id = $dom_wrapper_id;
46  $this->ui = $DIC->ui();
47  $this->lng = $DIC->language();
48  }
global $DIC
Definition: shib_login.php:26
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\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::getVideo ( )

◆ render()

ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::render ( )
Exceptions

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

References Vendor\Package\$f, ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI\$ui, and ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI\getVideo().

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

◆ setVideo()

ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::setVideo ( ?VideoItem  $a_val = null)

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

50  : void
51  {
52  $this->video = $a_val;
53  }

Field Documentation

◆ $dom_wrapper_id

string ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::$dom_wrapper_id
protected

◆ $lng

ilLanguage ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::$lng
protected

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

◆ $main_tpl

ilGlobalTemplateInterface ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::$main_tpl
protected

◆ $ui

ILIAS DI UIServices ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::$ui
protected

◆ $video

VideoItem ILIAS\ResourceStorage\Flavour\Machine\DefaultMachines\Extract\Video\VideoWidgetGUI::$video = null
protected

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