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)
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");
288 include_once(
"./Services/MediaObjects/classes/class.ilPlayerUtil.php");
291 if (in_array(
$mimeType, array(
"video/mp4",
"video/m4v",
"video/rtmp",
292 "video/x-flv",
"video/webm",
"video/youtube",
"video/vimeo",
"video/ogg")))
301 $mp_tpl =
new ilTemplate(
"tpl.flv_player.html",
true,
true,
"Services/MediaObjects");
308 $mp_tpl->setCurrentBlock(
"download");
309 $mp_tpl->setVariable(
"TXT_DOWNLOAD", $lng->txt(
"download"));
311 $mp_tpl->parseCurrentBlock();
314 $mp_tpl->setCurrentBlock(
"preview");
323 $mp_tpl->setVariable(
"IMG_ALT", $this->video_preview_pic_alt);
324 $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
325 $mp_tpl->parseCurrentBlock();
329 $mp_tpl->setCurrentBlock(
"source");
330 $mp_tpl->setVariable(
"FILE", $this->
getFile());
332 $mp_tpl->parseCurrentBlock();
336 $mp_tpl->setCurrentBlock(
"source");
339 $mp_tpl->parseCurrentBlock();
342 $mp_tpl->setCurrentBlock(
"mejs_video");
346 $mp_tpl->setVariable(
"CLASS",
"ilNoDisplay");
349 $mp_tpl->setVariable(
"PLAYER_NR", $this->
id.
"_".$this->current_nr);
350 $mp_tpl->setVariable(
"EVENT_URL", $this->event_callback_url);
353 if (is_int(strpos(
$mimeType,
"audio/mpeg")))
358 $mp_tpl->setVariable(
"DISPLAY_HEIGHT", $height);
359 $mp_tpl->setVariable(
"DISPLAY_WIDTH", $width);
362 $mp_tpl->setVariable(
"FFILE", $this->
getFile());
363 $mp_tpl->setVariable(
"TITLE", $this->
getTitle());
365 $mp_tpl->parseCurrentBlock();
372 if (is_int(strpos(
$mimeType,
"audio/mpeg")) ||
373 in_array(
$mimeType, array(
"application/ogg",
"audio/ogg")))
376 $mp_tpl =
new ilTemplate(
"tpl.flv_player.html",
true,
true,
"Services/MediaObjects");
377 $preview_output =
false;
382 $mp_tpl->setCurrentBlock(
"adownload");
383 $mp_tpl->setVariable(
"TXT_DOWNLOAD", $lng->txt(
"download"));
385 $mp_tpl->parseCurrentBlock();
388 $mp_tpl->setCurrentBlock(
"apreview");
397 $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
398 $mp_tpl->parseCurrentBlock();
399 $preview_output =
true;
401 $mp_tpl->setCurrentBlock(
"audio");
404 $mp_tpl->setVariable(
"ASTYLE",
"margin-top:-30px");
406 $mp_tpl->setVariable(
"AFILE", $this->
getFile());
407 $mp_tpl->setVariable(
"APLAYER_NR", $this->
id.
"_".$this->current_nr);
408 $mp_tpl->setVariable(
"AEVENT_URL", $this->event_callback_url);
409 $mp_tpl->setVariable(
"AHEIGHT",
"30");
410 $mp_tpl->setVariable(
"AWIDTH",
"320");
411 $mp_tpl->parseCurrentBlock();
412 return $mp_tpl->get();
418 $mp_tpl =
new ilTemplate(
"tpl.flv_player.html",
true,
true,
"Services/MediaObjects");
422 $mp_tpl->setCurrentBlock(
"idownload");
423 $mp_tpl->setVariable(
"TXT_DOWNLOAD", $lng->txt(
"download"));
425 $mp_tpl->parseCurrentBlock();
428 $mp_tpl->setCurrentBlock(
"ipreview");
435 $mp_tpl->setVariable(
"IMG_SRC", $this->
getFile());
437 $mp_tpl->setVariable(
"PTITLE", $this->
getTitle());
438 $mp_tpl->parseCurrentBlock();
440 $mp_tpl->setCurrentBlock(
"image");
441 $mp_tpl->setVariable(
"IFILE", $this->
getFile());
442 $mp_tpl->setVariable(
"IPLAYER_NR", $this->
id.
"_".$this->current_nr);
443 $mp_tpl->setVariable(
"ITITLE", $this->
getTitle());
449 $mp_tpl->setVariable(
"IHEIGHT", $height);
450 $mp_tpl->setVariable(
"IWIDTH", $width);
451 $mp_tpl->parseCurrentBlock();
453 return $mp_tpl->get();
459 && strpos(
$mimeType,
"audio/mpeg") ===
false
460 && strpos(
$mimeType,
"image/png") ===
false
461 && strpos(
$mimeType,
"image/gif") ===
false)
464 $html =
'<embed src="'.$this->getFile().
'" '.
465 'type="'.$mimeType.
'" '.
467 'autoplay="false" autostart="false" '.
468 'width="320" height="240" scale="aspect" ></embed>';
473 $tpl->addJavaScript(
"./Services/MediaObjects/flash_flv_player/swfobject.js");
474 $mp_tpl =
new ilTemplate(
"tpl.flv_player.html",
true,
true,
"Services/MediaObjects");
475 $mp_tpl->setCurrentBlock(
"default");
476 $mp_tpl->setVariable(
"FILE", urlencode($this->
getFile()));
477 $mp_tpl->setVariable(
"PLAYER_NR", $this->current_nr);
478 $mp_tpl->setVariable(
"DISPLAY_HEIGHT", strpos(
$mimeType,
"audio/mpeg") ===
false ?
"240" :
"20");
479 $mp_tpl->setVariable(
"DISPLAY_WIDTH",
"320");
480 $mp_tpl->parseCurrentBlock();
481 return $mp_tpl->get();