From 48f7a6e5e784880554d40a7f0cd5eb9ccd91046b Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Wed, 11 Feb 2026 15:38:06 +0100 Subject: [PATCH 1/3] 44965: Failed test: Player - Video: show --- components/ILIAS/UI/src/Component/Player/Video.php | 8 +++++++- .../UI/src/Implementation/Component/Player/Renderer.php | 2 ++ .../UI/src/Implementation/Component/Player/Video.php | 9 ++++++++- .../ILIAS/UI/src/examples/Player/Video/video_mp4.php | 4 ++-- .../ILIAS/UI/src/templates/default/Player/tpl.video.html | 2 +- .../ILIAS/UI/tests/Component/Player/PlayerVideoTest.php | 7 ++++--- 6 files changed, 24 insertions(+), 8 deletions(-) diff --git a/components/ILIAS/UI/src/Component/Player/Video.php b/components/ILIAS/UI/src/Component/Player/Video.php index e30e05f9fc21..48eff9bcec1c 100755 --- a/components/ILIAS/UI/src/Component/Player/Video.php +++ b/components/ILIAS/UI/src/Component/Player/Video.php @@ -33,7 +33,7 @@ interface Video extends Player * @param string $lang_key two letter lang key, e.g. "de", "en" * @param string $subtitle_file relative web root path of a vtt file */ - public function withAdditionalSubtitleFile(string $lang_key, string $subtitle_file): \ILIAS\UI\Component\Player\Video; + public function withAdditionalSubtitleFile(string $lang_key, string $subtitle_file, string $label): \ILIAS\UI\Component\Player\Video; /** * Get subtitle files @@ -41,6 +41,12 @@ public function withAdditionalSubtitleFile(string $lang_key, string $subtitle_fi */ public function getSubtitleFiles(): array; + /** + * Get subtitle labels + * @return array + */ + public function getSubtitleLabels(): array; + /** * Set initially shown poster image * @param string $poster relative web root path of an image file, URL of an external image resource (png,jpg,svg,gif) diff --git a/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php b/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php index 9489d4788a3e..3f4e876106a3 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php +++ b/components/ILIAS/UI/src/Implementation/Component/Player/Renderer.php @@ -128,10 +128,12 @@ public function renderNative( $id = $this->bindJavaScript($component); + $labels = $component->getSubtitleLabels(); foreach ($component->getSubtitleFiles() as $lang_key => $file) { $tpl->setCurrentBlock("track"); $tpl->setVariable("TRACK_SOURCE", $file); $tpl->setVariable("TRACK_LANG", $lang_key); + $tpl->setVariable("TRACK_LABEL", $labels[$lang_key] ?? ""); $tpl->parseCurrentBlock(); } diff --git a/components/ILIAS/UI/src/Implementation/Component/Player/Video.php b/components/ILIAS/UI/src/Implementation/Component/Player/Video.php index 51b678f8d96a..7e75fb70244c 100755 --- a/components/ILIAS/UI/src/Implementation/Component/Player/Video.php +++ b/components/ILIAS/UI/src/Implementation/Component/Player/Video.php @@ -34,11 +34,13 @@ class Video extends Player implements C\Player\Video private string $src = ""; private string $poster = ""; private array $subtitle_files = []; + private array $subtitle_labels = []; - public function withAdditionalSubtitleFile(string $lang_key, string $subtitle_file): C\Player\Video + public function withAdditionalSubtitleFile(string $lang_key, string $subtitle_file, string $label): C\Player\Video { $clone = clone $this; $clone->subtitle_files[$lang_key] = $subtitle_file; + $clone->subtitle_labels[$lang_key] = $label; return $clone; } @@ -47,6 +49,11 @@ public function getSubtitleFiles(): array return $this->subtitle_files; } + public function getSubtitleLabels(): array + { + return $this->subtitle_labels; + } + public function withPoster(string $poster): C\Player\Video { $clone = clone $this; diff --git a/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php b/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php index cc5e083ff7fb..ec9ec8f3bbf6 100755 --- a/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php +++ b/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php @@ -28,8 +28,8 @@ function video_mp4(): string $f = $DIC->ui()->factory(); $video = $f->player()->video("https://files.ilias.de/ks/ILIAS-Video.mp4"); - $video = $video->withAdditionalSubtitleFile("en", "./assets/ui-examples/misc/subtitles_en.vtt"); - $video = $video->withAdditionalSubtitleFile("de", "./assets/ui-examples/misc/subtitles_de.vtt"); + $video = $video->withAdditionalSubtitleFile("en", "./assets/ui-examples/misc/subtitles_en.vtt", "English"); + $video = $video->withAdditionalSubtitleFile("de", "./assets/ui-examples/misc/subtitles_de.vtt", "Deutsch"); return $renderer->render($video); } diff --git a/components/ILIAS/UI/src/templates/default/Player/tpl.video.html b/components/ILIAS/UI/src/templates/default/Player/tpl.video.html index 55ce14419688..09b53cd9b4b1 100755 --- a/components/ILIAS/UI/src/templates/default/Player/tpl.video.html +++ b/components/ILIAS/UI/src/templates/default/Player/tpl.video.html @@ -1,5 +1,5 @@
\ No newline at end of file diff --git a/components/ILIAS/UI/tests/Component/Player/PlayerVideoTest.php b/components/ILIAS/UI/tests/Component/Player/PlayerVideoTest.php index d97c8a61b2c9..569482b5571e 100755 --- a/components/ILIAS/UI/tests/Component/Player/PlayerVideoTest.php +++ b/components/ILIAS/UI/tests/Component/Player/PlayerVideoTest.php @@ -93,9 +93,10 @@ public function testGetTitleGetSubtitleFile(): void { $f = $this->getFactory(); - $video = $f->video("/foo")->withAdditionalSubtitleFile("en", "subtitles.vtt"); + $video = $f->video("/foo")->withAdditionalSubtitleFile("en", "subtitles.vtt", "English"); $this->assertEquals(["en" => "subtitles.vtt"], $video->getSubtitleFiles()); + $this->assertEquals(["en" => "English"], $video->getSubtitleLabels()); } public function testRenderVideo(): void @@ -143,13 +144,13 @@ public function testRenderWithSubtitles(): void $f = $this->getFactory(); $r = $this->getDefaultRenderer(); - $video = $f->video("/foo")->withAdditionalSubtitleFile("en", "subtitles.vtt"); + $video = $f->video("/foo")->withAdditionalSubtitleFile("en", "subtitles.vtt", "English"); $html = $r->render($video); $expected = << EOT; From 58a399dd8918bb7904c47a142e54e60fbd6905ee Mon Sep 17 00:00:00 2001 From: Alexander Killing Date: Wed, 11 Feb 2026 15:45:48 +0100 Subject: [PATCH 2/3] copyright fix --- components/ILIAS/UI/src/Component/Player/Video.php | 4 ++-- .../ILIAS/UI/src/Implementation/Component/Player/Video.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/components/ILIAS/UI/src/Component/Player/Video.php b/components/ILIAS/UI/src/Component/Player/Video.php index 48eff9bcec1c..b6d0469f20ab 100755 --- a/components/ILIAS/UI/src/Component/Player/Video.php +++ b/components/ILIAS/UI/src/Component/Player/Video.php @@ -1,7 +1,5 @@ Date: Wed, 11 Feb 2026 16:11:21 +0100 Subject: [PATCH 3/3] 44964: Adjust Expected Results: Component > Player > Video (Example 1: Video mp4) --- components/ILIAS/UI/src/examples/Player/Video/video_mp4.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php b/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php index ec9ec8f3bbf6..f410dd586f75 100755 --- a/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php +++ b/components/ILIAS/UI/src/examples/Player/Video/video_mp4.php @@ -11,9 +11,9 @@ * * expected output: > * ILIAS shows a rendered video player with a start screen. On the left side you will see a Start/Stop symbol, - * followed by a time bar and on the right side a symbol for subtitles (CC), volume control and for the the full screen. + * followed by a time bar and on the right side a symbol for subtitles (CC) (depends on browser), volume control and for the the full screen. * A big start symbol is shown in the middle of the start screen. While hovering over the subtitles symbol a list of all - * available languages appears. If a language gets selected you can find the text at the bottom of the full screen. + * available languages appears. If a language gets selected you can find the text above the time bar. * * In addition following functions have to be tested: * - The video starts playing if clicking the start/stop symbol in the middle of the image. The video stops after another click.