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;
 
  245                include_once(
"./Services/YUI/classes/class.ilYuiUtil.php");
 
  248                $tpl->addJavascript(
"./Services/MediaObjects/js/MediaObjects.js");
 
  250                if (!self::$lightbox_initialized && $a_preview)
 
  252                        include_once(
"./Services/UIComponent/Lightbox/classes/class.ilLightboxGUI.php");
 
  254                        $lb->setWidth(
"660px");
 
  256                        self::$lightbox_initialized = 
true;
 
  259                require_once 
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
 
  260                include_once(
"./Services/MediaObjects/classes/class.ilExternalMediaAnalyzer.php");
 
  275                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  280                                        $mp_tpl->setCurrentBlock(
"ytdownload");
 
  281                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  283                                        $mp_tpl->parseCurrentBlock();
 
  286                                $mp_tpl->setCurrentBlock(
"ytpreview");
 
  297                                $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
 
  298                                $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
 
  299                                $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
 
  300                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  301                                $mp_tpl->parseCurrentBlock();
 
  303                        $mp_tpl->setCurrentBlock(
"youtube");
 
  306                                $mp_tpl->setVariable(
"CLASS", 
"ilNoDisplay");
 
  308                        $mp_tpl->setVariable(
"PV", $p[
"v"]);
 
  309                        $mp_tpl->setVariable(
"PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  310                        $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
 
  312                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  317                        $mp_tpl->parseCurrentBlock();
 
  318                        return $mp_tpl->get();
 
  326                        $html = 
'<iframe src="http://player.vimeo.com/video/'.$p[
"id"].
'" width="320" height="240" '.
 
  327                                'frameborder="0"></iframe>';
 
  333                include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
  336                if (in_array(
$mimeType, array(
"video/mp4", 
"video/m4v", 
"video/rtmp",
 
  337                        "video/x-flv", 
"video/webm", 
"video/youtube", 
"video/vimeo", 
"video/ogg")))
 
  346                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  353                                        $mp_tpl->setCurrentBlock(
"download");
 
  354                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  356                                        $mp_tpl->parseCurrentBlock();
 
  359                                $mp_tpl->setCurrentBlock(
"preview");
 
  368                                $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
 
  369                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  370                                $mp_tpl->parseCurrentBlock();
 
  374                        $mp_tpl->setCurrentBlock(
"source");
 
  375                        $mp_tpl->setVariable(
"FILE", $this->
getFile());
 
  377                        $mp_tpl->parseCurrentBlock();
 
  381                                $mp_tpl->setCurrentBlock(
"source");
 
  384                                $mp_tpl->parseCurrentBlock();
 
  387                        $mp_tpl->setCurrentBlock(
"mejs_video");
 
  391                                $mp_tpl->setVariable(
"CLASS", 
"ilNoDisplay");
 
  394                        $mp_tpl->setVariable(
"PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  395                        $mp_tpl->setVariable(
"EVENT_URL", $this->event_callback_url);
 
  398                        if (is_int(strpos(
$mimeType,
"audio/mpeg")))
 
  403                        $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
 
  404                        $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
 
  407                        $mp_tpl->setVariable(
"FFILE", $this->
getFile());
 
  408                        $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
 
  410                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  415                        $mp_tpl->parseCurrentBlock();
 
  420                                $tpl->addOnLoadCode(
"new MediaElementPlayer('#player_".$this->
id.
"_".$this->current_nr.
"');");
 
  428                if (is_int(strpos(
$mimeType,
"audio/mpeg")) ||
 
  429                        in_array(
$mimeType, array(
"application/ogg", 
"audio/ogg")))
 
  432                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  433                        $preview_output = 
false;
 
  438                                        $mp_tpl->setCurrentBlock(
"adownload");
 
  439                                        $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  441                                        $mp_tpl->parseCurrentBlock();
 
  444                                $mp_tpl->setCurrentBlock(
"apreview");
 
  453                                $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  454                                $mp_tpl->parseCurrentBlock();
 
  455                                $preview_output = 
true;
 
  457                        $mp_tpl->setCurrentBlock(
"audio");
 
  460                                $mp_tpl->setVariable(
"ASTYLE", 
"margin-top:-30px");
 
  462                        $mp_tpl->setVariable(
"AFILE", $this->
getFile());
 
  463                        $mp_tpl->setVariable(
"APLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  464                        $mp_tpl->setVariable(
"AEVENT_URL", $this->event_callback_url);
 
  465                        $mp_tpl->setVariable(
"AHEIGHT", 
"30");
 
  466                        $mp_tpl->setVariable(
"AWIDTH", 
"320");
 
  467                        $mp_tpl->parseCurrentBlock();
 
  468                        return $mp_tpl->get();
 
  474                        $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  478                                $mp_tpl->setCurrentBlock(
"idownload");
 
  479                                $mp_tpl->setVariable(
"TXT_DOWNLOAD", 
$lng->txt(
"download"));
 
  481                                $mp_tpl->parseCurrentBlock();
 
  484                        $mp_tpl->setCurrentBlock(
"ipreview");
 
  491                                $mp_tpl->setVariable(
"IMG_SRC", $this->
getFile());
 
  493                        $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  494                        $mp_tpl->parseCurrentBlock();
 
  496                        $mp_tpl->setCurrentBlock(
"image");
 
  497                        $mp_tpl->setVariable(
"IFILE", $this->
getFile());
 
  498                        $mp_tpl->setVariable(
"IPLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  499                        $mp_tpl->setVariable(
"ITITLE", $this->
getTitle());
 
  501                        include_once(
"./Services/UIComponent/Glyph/classes/class.ilGlyphGUI.php");
 
  504                        if($this->event_callback_url)
 
  506                                $mp_tpl->setVariable(
"IMG_CALLBACK_URL", $this->event_callback_url);
 
  507                                $mp_tpl->setVariable(
"IMG_CALLBACK_PLAYER_NR", $this->
id.
"_".$this->current_nr);
 
  512                        $mp_tpl->parseCurrentBlock();
 
  514                        return $mp_tpl->get();
 
  520                 && strpos(
$mimeType,
"audio/mpeg") === 
false 
  521                 && strpos(
$mimeType,
"image/png") === 
false 
  522                 && strpos(
$mimeType,
"image/gif") === 
false)            
 
  525                        $html = 
'<embed src="'.$this->getFile().
'" '.
 
  526                                        'type="'.$mimeType.
'" '.
 
  528                                        'autoplay="false" autostart="false" '.
 
  529                                        'width="320" height="240" scale="aspect" ></embed>';
 
  534                $tpl->addJavaScript(
"./Services/MediaObjects/flash_flv_player/swfobject.js");           
 
  535                $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  536                $mp_tpl->setCurrentBlock(
"default");
 
  537                $mp_tpl->setVariable(
"FILE", urlencode($this->
getFile()));
 
  538                $mp_tpl->setVariable(
"PLAYER_NR", $this->current_nr);
 
  539                $mp_tpl->setVariable(
"DISPLAY_HEIGHT", strpos(
$mimeType,
"audio/mpeg") === 
false ? 
"240" : 
"20");
 
  540                $mp_tpl->setVariable(
"DISPLAY_WIDTH", 
"320");
 
  541                $mp_tpl->parseCurrentBlock();
 
  542                return $mp_tpl->get();
 
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.