ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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 
19  static function getLocalMediaElementJsPath()
20  {
21  return "./Services/MediaObjects/media_element_".self::$mejs_ver."/mediaelement-and-player.js";
22  }
23 
27  static function getLocalMediaElementCssPath()
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 
82  static function getFlashVideoPlayerDirectory()
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  {
98  return self::getFlashVideoPlayerDirectory()."/".$file;
99  }
100  return $file;
101  }
102 
109  static 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 ?>
static getCssFilePaths()
Get css file paths.
static rCopy($a_sdir, $a_tdir, $preserveTimeAttributes=false)
Copies content of a directory $a_sdir recursively to a directory $a_tdir.
static getFlashVideoPlayerFilename($a_fullpath=false)
Get flash video player file name.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
global $tpl
Definition: ilias.php:8
static getJsFilePaths()
Get js file paths.
static getLocalMediaElementJsPath()
Get local path of jQuery file.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
static getFlashVideoPlayerDirectory()
Get flash video player directory.
Create styles array
The data for the language used.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
Audio/Video Player Utility.