19 declare(strict_types=1);
36 return $this->
renderAudio($component, $default_renderer);
39 return $this->
renderVideo($component, $default_renderer);
46 $tpl = $this->
getTemplate(
"tpl.audio.html",
true,
true);
50 if ($component->getTranscription() !=
"") {
52 $page = $factory->modal()->lightboxTextPage(
53 $component->getTranscription(),
54 $this->
txt(
"ui_transcription")
56 $modal = $factory->modal()->lightbox($page);
57 $button = $factory->button()->standard($this->
txt(
"ui_transcription"),
'')
58 ->withOnClick($modal->getShowSignal());
60 $tpl->setCurrentBlock(
"transcription");
61 $tpl->setVariable(
"BUTTON_AND_MODAL", $default_renderer->render([$button, $modal]));
62 $tpl->parseCurrentBlock();
65 $tpl->setVariable(
"ID",
$id);
66 $tpl->setVariable(
"SOURCE", $component->getSource());
75 if ($this->
isVimeo($component)) {
97 $tpl = $this->
getTemplate(
"tpl.video_vimeo.html",
true,
true);
101 $tpl->setVariable(
"ID",
$id);
102 $tpl->setVariable(
"SOURCE", $component->getSource());
112 $tpl = $this->
getTemplate(
"tpl.video_youtube.html",
true,
true);
116 $tpl->setVariable(
"ID",
$id);
117 $tpl->setVariable(
"SOURCE", $component->getSource());
127 $tpl = $this->
getTemplate(
"tpl.video.html",
true,
true);
131 foreach ($component->getSubtitleFiles() as $lang_key => $file) {
132 $tpl->setCurrentBlock(
"track");
133 $tpl->setVariable(
"TRACK_SOURCE", $file);
134 $tpl->setVariable(
"TRACK_LANG", $lang_key);
135 $tpl->parseCurrentBlock();
138 if ($component->getPoster() !==
"") {
139 $tpl->setCurrentBlock(
"poster");
140 $tpl->setVariable(
"POSTER_SOURCE", $component->getPoster());
141 $tpl->parseCurrentBlock();
144 $tpl->setVariable(
"ID",
$id);
145 $tpl->setVariable(
"SOURCE", $component->getSource());
153 if (is_int(strpos($component->getSource(),
'vimeo.com'))) {
162 if (is_int(strpos($component->getSource(),
'youtube.com'))) {
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
txt(string $id)
Get a text from the language file.
render(Component\Component $component, RendererInterface $default_renderer)
renderNative(Component\Component $component, RendererInterface $default_renderer)
isVimeo(Component\Component $component)
renderAudio(Component\Component $component, RendererInterface $default_renderer)
getTemplate(string $name, bool $purge_unfilled_vars, bool $purge_unused_blocks)
Get template of component this renderer is made for.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
cannotHandleComponent(Component $component)
This method MUST be called by derived component renderers, if.
renderVimeo(Component\Component $component, RendererInterface $default_renderer)
isYoutube(Component\Component $component)
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
renderVideo(Component\Component $component, RendererInterface $default_renderer)
getUIFactory()
Get a UI factory.
renderYoutube(Component\Component $component, RendererInterface $default_renderer)
Base class for all component renderers.
bindJavaScript(JavaScriptBindable $component)
Bind the component to JavaScript.