19         protected static $nr = 1;
 
   39                 $this->file = $a_file;
 
   59                 $this->alt_video_file = $a_val;
 
   69                 return $this->alt_video_file;
 
   79                 $this->alt_video_mime = $a_val;
 
   89                 return $this->alt_video_mime;
 
   98                 $this->displayHeight = $dHeight;
 
  117                 $this->displayWidth = $a_val;
 
  131             $this->mimeType = $value;
 
  141                 $this->video_preview_pic = $a_val;
 
  142                 $this->video_preview_pic_alt = $a_alt;
 
  152                 return $this->video_preview_pic;
 
  162                 $this->title = $a_val;
 
  182                 $this->description = $a_val;
 
  202                 $this->force_audio_preview = $a_val;
 
  212                 return $this->force_audio_preview;
 
  222                 $tpl->addJavascript(
"./Services/MediaObjects/js/MediaObjects.js");
 
  224                 if (!self::$lightbox_initialized)
 
  226                         include_once(
"./Services/UIComponent/Lightbox/classes/class.ilLightboxGUI.php");
 
  228                         $lb->setWidth(
"660px");
 
  230                         self::$lightbox_initialized = 
true;
 
  233                 require_once 
'Services/MediaObjects/classes/class.ilObjMediaObject.php';
 
  234                 include_once(
"./Services/MediaObjects/classes/class.ilExternalMediaAnalyzer.php");
 
  262                 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
 
  265                 if (in_array(
$mimeType, array(
"video/mp4", 
"video/m4v", 
"video/rtmp",
 
  266                         "video/x-flv", 
"video/webm", 
"video/youtube", 
"video/vimeo", 
"video/ogg")))
 
  275                         $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  280                                 $mp_tpl->setCurrentBlock(
"preview");
 
  289                                 $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
 
  290                                 $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  291                                 $mp_tpl->parseCurrentBlock();
 
  295                         $mp_tpl->setCurrentBlock(
"source");
 
  296                         $mp_tpl->setVariable(
"FILE", $this->
getFile());
 
  298                         $mp_tpl->parseCurrentBlock();
 
  302                                 $mp_tpl->setCurrentBlock(
"source");
 
  305                                 $mp_tpl->parseCurrentBlock();
 
  308                         $mp_tpl->setCurrentBlock(
"mejs_video");
 
  312                                 $mp_tpl->setVariable(
"CLASS", 
"ilNoDisplay");
 
  315                         $mp_tpl->setVariable(
"PLAYER_NR", $this->current_nr);
 
  318                         if (is_int(strpos(
$mimeType,
"audio/mpeg")))
 
  323                         $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
 
  324                         $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
 
  327                         $mp_tpl->setVariable(
"FFILE", $this->
getFile());
 
  328                         $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
 
  330                         $mp_tpl->parseCurrentBlock();
 
  337                 if (is_int(strpos(
$mimeType,
"audio/mpeg")) ||
 
  338                         in_array(
$mimeType, array(
"application/ogg", 
"audio/ogg")))
 
  341                         $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  342                         $preview_output = 
false;
 
  345                                 $mp_tpl->setCurrentBlock(
"apreview");
 
  354                                 $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  355                                 $mp_tpl->parseCurrentBlock();
 
  356                                 $preview_output = 
true;
 
  358                         $mp_tpl->setCurrentBlock(
"audio");
 
  361                                 $mp_tpl->setVariable(
"ASTYLE", 
"margin-top:-30px");
 
  363                         $mp_tpl->setVariable(
"AFILE", $this->
getFile());
 
  364                         $mp_tpl->setVariable(
"APLAYER_NR", $this->current_nr);
 
  365                         $mp_tpl->setVariable(
"AHEIGHT", 
"30");
 
  366                         $mp_tpl->setVariable(
"AWIDTH", 
"320");
 
  367                         $mp_tpl->parseCurrentBlock();
 
  368                         return $mp_tpl->get();
 
  374                         $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  375                         $mp_tpl->setCurrentBlock(
"ipreview");
 
  382                                 $mp_tpl->setVariable(
"IMG_SRC", $this->
getFile());
 
  384                         $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
 
  385                         $mp_tpl->parseCurrentBlock();
 
  387                         $mp_tpl->setCurrentBlock(
"image");
 
  388                         $mp_tpl->setVariable(
"IFILE", $this->
getFile());
 
  389                         $mp_tpl->setVariable(
"IPLAYER_NR", $this->current_nr);
 
  390                         $mp_tpl->setVariable(
"ITITLE", $this->
getTitle());
 
  396                         $mp_tpl->setVariable(
"IHEIGHT", $height);
 
  397                         $mp_tpl->setVariable(
"IWIDTH", $width);
 
  398                         $mp_tpl->parseCurrentBlock();
 
  400                         return $mp_tpl->get();
 
  406                  && strpos(
$mimeType,
"audio/mpeg") === 
false 
  407                  && strpos(
$mimeType,
"image/png") === 
false 
  408                  && strpos(
$mimeType,
"image/gif") === 
false)            
 
  411                         $html = 
'<embed src="'.$this->getFile().
'" '.
 
  412                                         'type="'.$mimeType.
'" '.
 
  414                                         'autoplay="false" autostart="false" '.
 
  415                                         'width="320" height="240" scale="aspect" ></embed>';
 
  420                 $tpl->addJavaScript(
"./Services/MediaObjects/flash_flv_player/swfobject.js");           
 
  421                 $mp_tpl = 
new ilTemplate(
"tpl.flv_player.html", 
true, 
true, 
"Services/MediaObjects");
 
  422                 $mp_tpl->setCurrentBlock(
"default");
 
  423                 $mp_tpl->setVariable(
"FILE", urlencode($this->
getFile()));
 
  424                 $mp_tpl->setVariable(
"PLAYER_NR", $this->current_nr);
 
  425                 $mp_tpl->setVariable(
"DISPLAY_HEIGHT", strpos(
$mimeType,
"audio/mpeg") === 
false ? 
"240" : 
"20");
 
  426                 $mp_tpl->setVariable(
"DISPLAY_WIDTH", 
"320");
 
  427                 $mp_tpl->parseCurrentBlock();
 
  428                 return $mp_tpl->get();