/** * 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'] . '_'); }
<?php include "../../OSMPlayer.php"; $player = new OSMPlayer(array('playlist' => 'playlist.xml', 'debug' => true, 'prefix' => '', 'base_path' => '../..', 'base_url' => '../..', 'theme' => '', 'template' => 'default')); ?> <html> <head> <title>Open Standard Media (OSM) Player: Template Development</title> <script type="text/javascript" src="../../jquery-ui/js/jquery.js"></script> <?php print $player->getHeader(); ?> </head> <body> <?php print $player->getPlayer(); ?> </body> </html>