ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilPlayerUtil.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4
13{
17 public static function getLocalMediaElementJsPath()
18 {
19 return "./node_modules/mediaelement/build/mediaelement-and-player.min.js";
20 }
21
25 public static function getLocalMediaElementCssPath()
26 {
27 return "./node_modules/mediaelement/build/mediaelementplayer.min.css";
28 }
29
33 public static function initMediaElementJs($a_tpl = null)
34 {
35 global $DIC;
36
37 $tpl = $DIC["tpl"];
38
39 if ($a_tpl == null) {
40 $a_tpl = $tpl;
41 }
42
43 foreach (self::getJsFilePaths() as $js_path) {
44 $a_tpl->addJavaScript($js_path);
45 }
46 foreach (self::getCssFilePaths() as $css_path) {
47 $a_tpl->addCss($css_path);
48 }
49 }
50
57 public static function getCssFilePaths()
58 {
59 return array(self::getLocalMediaElementCssPath());
60 }
61
68 public static function getJsFilePaths()
69 {
70 return array(
71 self::getLocalMediaElementJsPath(),
72 "./Services/MediaObjects/js/MediaElementHelper.js"
73 );
74 }
75
76
82 public static function getFlashVideoPlayerDirectory()
83 {
84 return "node_modules/mediaelement/build";
85 }
86
87
93 public static function getFlashVideoPlayerFilename($a_fullpath = false)
94 {
95 $file = "flashmediaelement.swf";
96 if ($a_fullpath) {
97 return self::getFlashVideoPlayerDirectory() . "/" . $file;
98 }
99 return $file;
100 }
101
108 public static function copyPlayerFilesToTargetDirectory($a_target_dir)
109 {
111 "./node_modules/mediaelement/build",
112 $a_target_dir
113 );
114 }
115}
An exception for terminatinating execution or to throw for unit testing.
Audio/Video Player Utility.
static getLocalMediaElementJsPath()
Get local path of jQuery file.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static getFlashVideoPlayerFilename($a_fullpath=false)
Get flash video player file name.
static getJsFilePaths()
Get js file paths.
static getCssFilePaths()
Get css file paths.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
global $DIC
Definition: goto.php:24
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl
Definition: latex.php:41