ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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{
14 private static $mejs_ver = "2_14_2";
15
20 {
21 return "./Services/MediaObjects/media_element_".self::$mejs_ver."/mediaelement-and-player.js";
22 }
23
28 {
29 return "./Services/MediaObjects/media_element_".self::$mejs_ver."/mediaelementplayer.min.css";
30 }
31
35 static function initMediaElementJs($a_tpl = null)
36 {
37 global $tpl;
38
39 if ($a_tpl == null)
40 {
41 $a_tpl = $tpl;
42 }
43
44 foreach (self::getJsFilePaths() as $js_path)
45 {
46 $a_tpl->addJavaScript($js_path);
47 }
48 foreach (self::getCssFilePaths() as $css_path)
49 {
50 $a_tpl->addCss($css_path);
51 }
52 }
53
60 static function getCssFilePaths()
61 {
62 return array(self::getLocalMediaElementCssPath());
63 }
64
71 static function getJsFilePaths()
72 {
73 return array(self::getLocalMediaElementJsPath());
74 }
75
76
83 {
84 return "Services/MediaObjects/media_element_2_14_2";
85 }
86
87
93 static function getFlashVideoPlayerFilename($a_fullpath = false)
94 {
95 $file = "flashmediaelement.swf";
96 if ($a_fullpath)
97 {
99 }
100 return $file;
101 }
102
109 function copyPlayerFilesToTargetDirectory($a_target_dir)
110 {
111 ilUtil::rCopy("./Services/MediaObjects/media_element_".self::$mejs_ver,
112 $a_target_dir);
113 }
114
115}
116
117?>
print $file
global $tpl
Definition: ilias.php:8
Audio/Video Player Utility.
getLocalMediaElementCssPath()
Get local path of jQuery file.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
static getFlashVideoPlayerFilename($a_fullpath=false)
Get flash video player file name.
getLocalMediaElementJsPath()
Get local path of jQuery file.
static getJsFilePaths()
Get js file paths.
static getCssFilePaths()
Get css file paths.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
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.