Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function renderAudio(Component\Component $component, RendererInterface $d
{
$tpl = $this->getTemplate("tpl.audio.html", true, true);

$id = $this->bindJavaScript($component);
$id = $this->bindJavaScript($component) ?? $this->createId();

if ($component->getTranscription() != "") {
$factory = $this->getUIFactory();
Expand Down Expand Up @@ -96,7 +96,7 @@ public function renderVimeo(

$tpl = $this->getTemplate("tpl.video_vimeo.html", true, true);

$id = $this->bindJavaScript($component);
$id = $this->bindJavaScript($component) ?? $this->createId();

$tpl->setVariable("ID", $id);
$tpl->setVariable("SOURCE", $component->getSource());
Expand All @@ -111,7 +111,7 @@ public function renderYoutube(

$tpl = $this->getTemplate("tpl.video_youtube.html", true, true);

$id = $this->bindJavaScript($component);
$id = $this->bindJavaScript($component) ?? $this->createId();

$tpl->setVariable("ID", $id);
$tpl->setVariable("SOURCE", $component->getSource());
Expand All @@ -126,7 +126,7 @@ public function renderNative(

$tpl = $this->getTemplate("tpl.video.html", true, true);

$id = $this->bindJavaScript($component);
$id = $this->bindJavaScript($component) ?? $this->createId();

foreach ($component->getSubtitleFiles() as $lang_key => $file) {
$tpl->setCurrentBlock("track");
Expand Down
2 changes: 1 addition & 1 deletion components/ILIAS/UI/tests/Component/Item/ItemTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ public function testRenderAudioPlayer(): void
<div class="il-item il-std-item ">
<h4 class="il-item-title">title</h4>
<div class="il-item-audio"><div class="il-audio-container">
<audio controls="controls" class="il-audio-player" id="" src="src" preload="metadata"></audio>
<audio controls="controls" class="il-audio-player" id="id_1" src="src" preload="metadata"></audio>
</div></div>
</div>
EOT;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public function testRenderAudio(): void

$expected = <<<EOT
<div class="il-audio-container">
<audio controls="controls" class="il-audio-player" id="" src="/foo" preload="metadata"></audio>
<audio controls="controls" class="il-audio-player" id="id_1" src="/foo" preload="metadata"></audio>
</div>
EOT;
$this->assertHTMLEquals(
Expand Down
10 changes: 5 additions & 5 deletions components/ILIAS/UI/tests/Component/Player/PlayerVideoTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public function testRenderVideo(): void
$html = $r->render($video);
$expected = <<<EOT
<div class="il-video-container">
<video controls="controls" class="il-video-player" id="" src="/foo" preload="metadata" >
<video controls="controls" class="il-video-player" id="id_1" src="/foo" preload="metadata" >
</video>
</div>
EOT;
Expand All @@ -128,7 +128,7 @@ public function testRenderWithPoster(): void
$html = $r->render($video);
$expected = <<<EOT
<div class="il-video-container">
<video controls="controls" class="il-video-player" id="" src="/foo" preload="metadata" poster="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="background-image:url('bar.jpg')">
<video controls="controls" class="il-video-player" id="id_1" src="/foo" preload="metadata" poster="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" style="background-image:url('bar.jpg')">
</video>
</div>
EOT;
Expand All @@ -148,7 +148,7 @@ public function testRenderWithSubtitles(): void
$html = $r->render($video);
$expected = <<<EOT
<div class="il-video-container">
<video controls="controls" class="il-video-player" id="" src="/foo" preload="metadata" >
<video controls="controls" class="il-video-player" id="id_1" src="/foo" preload="metadata" >
<track kind="subtitles" src="subtitles.vtt" srclang="en" />
</video>
</div>
Expand All @@ -170,7 +170,7 @@ public function testRenderYoutube(): void

$expected = <<<EOT
<div class="il-video-container">
<iframe id="" src="https://www.youtube.com/embed/YSN2osYbshQ" allow="fullscreen; autoplay; picture-in-picture;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<iframe id="id_1" src="https://www.youtube.com/embed/YSN2osYbshQ" allow="fullscreen; autoplay; picture-in-picture;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>
EOT;
$this->assertHTMLEquals(
Expand All @@ -190,7 +190,7 @@ public function testRenderVimeo(): void

$expected = <<<EOT
<div class="il-video-container">
<iframe id="" src="https://player.vimeo.com/video/669475821" allow="fullscreen; autoplay; picture-in-picture;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
<iframe id="id_1" src="https://player.vimeo.com/video/669475821" allow="fullscreen; autoplay; picture-in-picture;" referrerpolicy="strict-origin-when-cross-origin"></iframe>
</div>
EOT;
$this->assertHTMLEquals(
Expand Down