ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
with_audio_player.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
6 
19 function with_audio_player(): string
20 {
21  global $DIC;
22  $f = $DIC->ui()->factory();
23  $renderer = $DIC->ui()->renderer();
24 
25  $actions = $f->dropdown()->standard(array(
26  $f->button()->shy("ILIAS", "https://www.ilias.de"),
27  $f->button()->shy("GitHub", "https://www.github.com")
28  ));
29 
30  $audio = $f->player()->audio("https://files.ilias.de/ILIAS-Audio.mp3", "");
31 
32  $app_item = $f->item()->standard("ILIAS Audio")
33  ->withActions($actions)
34  ->withAudioPlayer($audio)
35  ->withProperties(array(
36  "Length" => "00:00:26"))
37  ->withDescription("Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.")
38  ->withLeadImage($f->image()->responsive(
39  "assets/ui-examples/images/Image/HeaderIconLarge.svg",
40  "Thumbnail Example"
41  ));
42  return $renderer->render($app_item);
43 }
$renderer
global $DIC
Definition: shib_login.php:25
with_audio_player()
description: > Example for rendering a standard item with an audio player.