19        protected static $nr = 1;
 
   30                $this->event_callback_url = $a_event_callback_url;
 
   42                $this->file = $a_file;
 
   62                $this->alt_video_file = $a_val;
 
   72                return $this->alt_video_file;
 
   82                $this->alt_video_mime = $a_val;
 
   92                return $this->alt_video_mime;
 
  101                $this->displayHeight = $dHeight;
 
  120                $this->displayWidth = $a_val;
 
  134            $this->mimeType = $value;
 
  144                $this->video_preview_pic = $a_val;
 
  145                $this->video_preview_pic_alt = $a_alt;
 
  155                return $this->video_preview_pic;
 
  165                $this->title = $a_val;
 
  185                $this->description = $a_val;
 
  205                $this->force_audio_preview = $a_val;
 
  215                return $this->force_audio_preview;
 
  225                $this->download_link = $a_val;
 
  251                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
  254                $a_tpl->addJavascript(
"./Services/MediaObjects/js/MediaObjects.js");
 
  256                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
  270                if (!self::$lightbox_initialized && $a_preview)
 
  272                        include_once(
"./Services/UIComponent/Lightbox/classes/class.ilLightboxGUI.php");
 
  274                        $lb->setWidth(
"660px");
 
  276                        self::$lightbox_initialized = 
true;
 
  279                require_once 
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
 
  280                include_once(
"./Services/MediaObjects/classes/class.ilExternalMediaAnalyzer.php");
 
  295                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  300                                        $mp_tpl->setCurrentBlock(
"ytdownload");
 
  301                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  303                                        $mp_tpl->parseCurrentBlock();
 
  306                                $mp_tpl->setCurrentBlock(
"ytpreview");
 
  317                                $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
 
  318                                $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
 
  319                                $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
 
  320                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  321                                $mp_tpl->parseCurrentBlock();
 
  323                        $mp_tpl->setCurrentBlock(
"youtube");
 
  326                                $mp_tpl->setVariable(
"CLASS", 
"ilNoDisplay");
 
  328                        $mp_tpl->setVariable(
"PV", $p[
"v"]);
 
  329                        $mp_tpl->setVariable(
"PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  330                        $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
 
  332                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  337                        $mp_tpl->parseCurrentBlock();
 
  338                        return $mp_tpl->get();
 
  346                        $html = 
'<iframe src="http://player.vimeo.com/video/'.$p[
"id"].
'" width="320" height="240" '.
 
  347                                'frameborder="0"></iframe>';
 
  353                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
  356                if (in_array(
$mimeType, array(
"video/mp4", 
"video/m4v", 
"video/rtmp",
 
  357                        "video/x-flv", 
"video/webm", 
"video/youtube", 
"video/vimeo", 
"video/ogg")))
 
  365                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  372                                        $mp_tpl->setCurrentBlock(
"download");
 
  373                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  375                                        $mp_tpl->parseCurrentBlock();
 
  378                                $mp_tpl->setCurrentBlock(
"preview");
 
  387                                $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
 
  388                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  389                                $mp_tpl->parseCurrentBlock();
 
  393                        $mp_tpl->setCurrentBlock(
"source");
 
  394                        $mp_tpl->setVariable(
"FILE", $this->
getFile());
 
  396                        $mp_tpl->parseCurrentBlock();
 
  400                                $mp_tpl->setCurrentBlock(
"source");
 
  403                                $mp_tpl->parseCurrentBlock();
 
  406                        $mp_tpl->setCurrentBlock(
"mejs_video");
 
  410                                $mp_tpl->setVariable(
"CLASS", 
"ilNoDisplay");
 
  413                        $mp_tpl->setVariable(
"PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  414                        $mp_tpl->setVariable(
"EVENT_URL", $this->event_callback_url);
 
  417                        if (is_int(strpos(
$mimeType,
"audio/mpeg")))
 
  422                        $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
 
  423                        $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
 
  426                        $mp_tpl->setVariable(
"FFILE", $this->
getFile());
 
  427                        $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
 
  429                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  434                        $mp_tpl->parseCurrentBlock();
 
  439                                $tpl->addOnLoadCode(
"new MediaElementPlayer('#player_".$this->
id.
"_".$this->current_nr.
"');");
 
  447                if (is_int(strpos(
$mimeType,
"audio/mpeg")) ||
 
  448                        in_array(
$mimeType, array(
"application/ogg", 
"audio/ogg")))
 
  451                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  452                        $preview_output = 
false;
 
  457                                        $mp_tpl->setCurrentBlock(
"adownload");
 
  458                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  460                                        $mp_tpl->parseCurrentBlock();
 
  463                                $mp_tpl->setCurrentBlock(
"apreview");
 
  472                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  473                                $mp_tpl->parseCurrentBlock();
 
  474                                $preview_output = 
true;
 
  476                        $mp_tpl->setCurrentBlock(
"audio");
 
  479                                $mp_tpl->setVariable(
"ASTYLE", 
"margin-top:-30px");
 
  481                        $mp_tpl->setVariable(
"AFILE", $this->
getFile());
 
  482                        $mp_tpl->setVariable(
"APLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  483                        $mp_tpl->setVariable(
"AEVENT_URL", $this->event_callback_url);
 
  484                        $mp_tpl->setVariable(
"AHEIGHT", 
"30");
 
  485                        $mp_tpl->setVariable(
"AWIDTH", 
"320");
 
  486                        $mp_tpl->parseCurrentBlock();
 
  487                        return $mp_tpl->get();
 
  493                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  497                                $mp_tpl->setCurrentBlock(
"idownload");
 
  498                                $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  500                                $mp_tpl->parseCurrentBlock();
 
  503                        $mp_tpl->setCurrentBlock(
"ipreview");
 
  510                                $mp_tpl->setVariable(
"IMG_SRC", $this->
getFile());
 
  512                        $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  513                        $mp_tpl->parseCurrentBlock();
 
  515                        $mp_tpl->setCurrentBlock(
"image");
 
  516                        $mp_tpl->setVariable(
"IFILE", $this->
getFile());
 
  517                        $mp_tpl->setVariable(
"IPLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  518                        $mp_tpl->setVariable(
"ITITLE", $this->
getTitle());
 
  520                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  523                        if($this->event_callback_url)
 
  525                                $mp_tpl->setVariable(
"IMG_CALLBACK_URL", $this->event_callback_url);
 
  526                                $mp_tpl->setVariable(
"IMG_CALLBACK_PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  531                        $mp_tpl->parseCurrentBlock();
 
  533                        return $mp_tpl->get();
 
  539                 && strpos(
$mimeType,
"audio/mpeg") === 
false 
  540                 && strpos(
$mimeType,
"image/png") === 
false 
  541                 && strpos(
$mimeType,
"image/gif") === 
false)            
 
  544                        $html = 
'<embed src="'.$this->getFile().
'" '.
 
  545                                        'type="'.$mimeType.
'" '.
 
  547                                        'autoplay="false" autostart="false" '.
 
  548                                        'width="320" height="240" scale="aspect" ></embed>';
 
  553                $tpl->addJavaScript(
"./Services/MediaObjects/flash_flv_player/swfobject.js");           
 
  554                $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  555                $mp_tpl->setCurrentBlock(
"default");
 
  556                $mp_tpl->setVariable(
"FILE", urlencode($this->
getFile()));
 
  557                $mp_tpl->setVariable(
"PLAYER_NR", $this->current_nr);
 
  558                $mp_tpl->setVariable(
"DISPLAY_HEIGHT", strpos(
$mimeType,
"audio/mpeg") === 
false ? 
"240" : 
"20");
 
  559                $mp_tpl->setVariable(
"DISPLAY_WIDTH", 
"320");
 
  560                $mp_tpl->parseCurrentBlock();
 
  561                return $mp_tpl->get();
 
An exception for terminatinating execution or to throw for unit testing.
static get($a_glyph, $a_text="")
Get glyph html.
static getFlashVideoPlayerFilename($a_fullpath=false)
Get flash video player file name.
static initMediaElementJs($a_tpl=null)
Init mediaelement.js scripts.
special template class to simplify handling of ITX/PEAR
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static initConnection()
Init YUI Connection module.