ILIAS  release_8 Revision v8.24
class.ilPlayerUtil.php
Go to the documentation of this file.
1<?php
2
26{
27 public static function getLocalMediaElementJsPath(): array
28 {
29 return [
30 "./node_modules/mediaelement/build/mediaelement-and-player.min.js",
31 "./node_modules/mediaelement/build/renderers/vimeo.min.js"
32 ];
33 }
34
38 public static function getLocalMediaElementCssPath(): string
39 {
40 return "./node_modules/mediaelement/build/mediaelementplayer.min.css";
41 }
42
46 public static function initMediaElementJs(
47 ilGlobalTemplateInterface $a_tpl = null
48 ): void {
49 global $DIC;
50
51 $tpl = $DIC["tpl"];
52
53 if ($a_tpl == null) {
54 $a_tpl = $tpl;
55 }
56
57 foreach (self::getJsFilePaths() as $js_path) {
58 $a_tpl->addJavaScript($js_path);
59 }
60 foreach (self::getCssFilePaths() as $css_path) {
61 $a_tpl->addCss($css_path);
62 }
63 }
64
68 public static function getCssFilePaths(): array
69 {
70 return array(self::getLocalMediaElementCssPath());
71 }
72
76 public static function getJsFilePaths(): array
77 {
78 return self::getLocalMediaElementJsPath();
79 }
80
81 public static function getFlashVideoPlayerDirectory(): string
82 {
83 return "node_modules/mediaelement/build";
84 }
85
86 public static function getFlashVideoPlayerFilename(
87 bool $a_fullpath = false
88 ): string {
89 $file = "flashmediaelement.swf";
90 if ($a_fullpath) {
91 return self::getFlashVideoPlayerDirectory() . "/" . $file;
92 }
93 return $file;
94 }
95
96 public static function copyPlayerFilesToTargetDirectory(
97 string $a_target_dir
98 ): void {
99 ilFileUtils::rCopy(
100 "./node_modules/mediaelement/build",
101 $a_target_dir
102 );
103 }
104}
Class ilFileUtils.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLocalMediaElementJsPath()
static getFlashVideoPlayerDirectory()
static getJsFilePaths()
static initMediaElementJs(ilGlobalTemplateInterface $a_tpl=null)
Init mediaelement.js scripts.
static getFlashVideoPlayerFilename(bool $a_fullpath=false)
static getCssFilePaths()
static copyPlayerFilesToTargetDirectory(string $a_target_dir)
static getLocalMediaElementCssPath()
Get local path of jQuery file.
global $DIC
Definition: feed.php:28
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41