ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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 "./libs/bower/bower_components/mediaelement/build/mediaelement-and-player.min.js";
20  }
21 
25  public static function getLocalMediaElementCssPath()
26  {
27  return "./libs/bower/bower_components/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(self::getLocalMediaElementJsPath());
71  }
72 
73 
79  public static function getFlashVideoPlayerDirectory()
80  {
81  return "libs/bower/bower_components/mediaelement/build";
82  }
83 
84 
90  public static function getFlashVideoPlayerFilename($a_fullpath = false)
91  {
92  $file = "flashmediaelement.swf";
93  if ($a_fullpath) {
94  return self::getFlashVideoPlayerDirectory() . "/" . $file;
95  }
96  return $file;
97  }
98 
105  public static function copyPlayerFilesToTargetDirectory($a_target_dir)
106  {
108  "./libs/bower/bower_components/mediaelement/build",
109  $a_target_dir
110  );
111  }
112 }
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.
global $DIC
Definition: saml.php:7
$tpl
Definition: ilias.php:10
static getFlashVideoPlayerFilename($a_fullpath=false)
Get flash video player file name.
static getLocalMediaElementCssPath()
Get local path of jQuery file.
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.
static copyPlayerFilesToTargetDirectory($a_target_dir)
Copy css files to target dir.