ILIAS  Release_4_1_x_branch Revision 61804
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilMediaPlayerGUI Class Reference

User interface for media player. More...

+ Collaboration diagram for ilMediaPlayerGUI:

Public Member Functions

 __construct ()
 setFile ($a_file)
 Set File.
 getFile ()
 Get File.
 setDisplayHeight ($dHeight)
 set display height
 getDisplayHeight ()
 return display height of player.
 setMimeType ($value)
 getMp3PlayerHtml ()
 Get Html for MP3 Player.

Data Fields

 $file
 $displayHeight
 $mimeType

Static Public Attributes

static $nr = 1

Detailed Description

User interface for media player.

Wraps flash mp3 player and similar tools.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 32 of file class.ilMediaPlayerGUI.php.

Constructor & Destructor Documentation

ilMediaPlayerGUI::__construct ( )

Definition at line 39 of file class.ilMediaPlayerGUI.php.

{
}

Member Function Documentation

ilMediaPlayerGUI::getDisplayHeight ( )

return display height of player.

Returns
int

Definition at line 77 of file class.ilMediaPlayerGUI.php.

References $displayHeight.

{
}
ilMediaPlayerGUI::getFile ( )

Get File.

Returns
string File

Definition at line 58 of file class.ilMediaPlayerGUI.php.

References $file.

Referenced by getMp3PlayerHtml().

{
return $this->file;
}

+ Here is the caller graph for this function:

ilMediaPlayerGUI::getMp3PlayerHtml ( )

Get Html for MP3 Player.

Definition at line 89 of file class.ilMediaPlayerGUI.php.

References $mimeType, $tpl, ilExternalMediaAnalyzer\extractVimeoParameters(), ilExternalMediaAnalyzer\extractYouTubeParameters(), getFile(), ilObjMediaObject\getMimeType(), ilExternalMediaAnalyzer\isVimeo(), and ilExternalMediaAnalyzer\isYouTube().

{
global $tpl;
require_once 'Services/MediaObjects/classes/class.ilObjMediaObject.php';
include_once("./Services/MediaObjects/classes/class.ilExternalMediaAnalyzer.php");
// youtube
{
$html = '<object width="320" height="240">'.
'<param name="movie" value="http://www.youtube.com/v/'.$p["v"].'?fs=1">'.
'</param><param name="allowFullScreen" value="true"></param>'.
'<param name="allowscriptaccess" value="always">'.
'</param><embed src="http://www.youtube.com/v/'.$p["v"].'?fs=1" '.
'type="application/x-shockwave-flash" allowscriptaccess="always" '.
'allowfullscreen="true" width="320" height="240"></embed></object>';
return $html;
}
// vimeo
{
$html = '<iframe src="http://player.vimeo.com/video/'.$p["id"].'" width="320" height="240" '.
'frameborder="0"></iframe>';
return $html;
}
$mimeType = $this->mimeType == "" ? ilObjMediaObject::getMimeType(basename($this->getFile())) : $this->mimeType;
if (strpos($mimeType,"flv") === false
&& strpos($mimeType,"audio/mpeg") === false
&& strpos($mimeType,"image/png") === false
&& strpos($mimeType,"image/gif") === false)
{
$html = '<embed src="'.$this->getFile().'" '.
'type="'.$mimeType.'" '.
'autoplay="false" autostart="false" '.
'width="320" height="240" scale="aspect" ></embed>';
return $html;
}
$tpl->addJavaScript("./Services/MediaObjects/flash_flv_player/swfobject.js");
$mp_tpl = new ilTemplate("tpl.flv_player.html", true, true, "Services/MediaObjects");
$mp_tpl->setVariable("FILE", urlencode($this->getFile()));
$mp_tpl->setVariable("PLAYER_NR", self::$nr);
$mp_tpl->setVariable("DISPLAY_HEIGHT", strpos($mimeType,"audio/mpeg") === false ? "240" : "20");
$mp_tpl->setVariable("DISPLAY_WIDTH", "320");
self::$nr++;
return $mp_tpl->get();
}

+ Here is the call graph for this function:

ilMediaPlayerGUI::setDisplayHeight (   $dHeight)

set display height

Parameters
int$dHeight

Definition at line 68 of file class.ilMediaPlayerGUI.php.

{
$this->displayHeight = $dHeight;
}
ilMediaPlayerGUI::setFile (   $a_file)

Set File.

Parameters
string$a_fileFile

Definition at line 48 of file class.ilMediaPlayerGUI.php.

{
$this->file = $a_file;
}
ilMediaPlayerGUI::setMimeType (   $value)

Definition at line 82 of file class.ilMediaPlayerGUI.php.

{
$this->mimeType = $value;
}

Field Documentation

ilMediaPlayerGUI::$displayHeight

Definition at line 35 of file class.ilMediaPlayerGUI.php.

Referenced by getDisplayHeight().

ilMediaPlayerGUI::$file

Definition at line 34 of file class.ilMediaPlayerGUI.php.

Referenced by getFile().

ilMediaPlayerGUI::$mimeType

Definition at line 36 of file class.ilMediaPlayerGUI.php.

Referenced by getMp3PlayerHtml().

ilMediaPlayerGUI::$nr = 1
static

Definition at line 37 of file class.ilMediaPlayerGUI.php.


The documentation for this class was generated from the following file: