ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
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  {
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 ?>