Exemplo n.º 1
0
 /**
  * Constructor.
  *
  * Creates a new instance of a media player.
  *
  * Usage:
  *
  *    $player = new OSMPlayer(array(
  *       'width' => 640,
  *       'height' => 480,
  *       'playlist' => 'http://www.mysite.com/playlist.xml'
  *    ));
  */
 public function __construct($_params = array())
 {
     // First set the defaults.
     $this->playerParams = OSMPlayer::getPlayerParams();
     $this->settings = array_merge($this->playerParams, OSMPlayer::getPlayerSettings());
     if ($_params) {
         // Set the parameters ( which will override the defaults ).
         $this->settings = array_merge($this->settings, $_params);
     }
     // Create our template.
     $templateClass = ucfirst($this->settings['template']) . 'Template';
     require_once "OSMTemplate.php";
     require_once "templates/" . $this->settings['template'] . "/template.php";
     $this->template = new $templateClass($this->settings);
     // Make sure we set the Prefix.
     $this->setPrefix(isset($_params['prefix']) ? $_params['prefix'] : $this->settings['id'] . '_');
 }