id = "jwplayer-" . $divId; $this->path = $player_path; $this->conf = $config; $this->cls = $config; $this->init($params, $flash_vars); } /** * Perform the necessary initialization operations to prepare the SWFObject javascript object. * @param array $params The list of SWFObject params * @param $flash_vars * * @internal param array $flashVars The list of additional flashvars to be used in the embed */ private function init($params, $flash_vars) { $wmode = isset($flash_vars["wmode"]) ? $flash_vars["wmode"] : "opaque"; //Initialize defaults. $default_params = array( "width" => 400, "height" => 280, "allowfullscreen" => "true", "allowscriptaccess" => "always", "wmode" => $wmode, "version" => "9", "type" => "movie", "bgcolor" => "#FFFFFF", "express_redirect" => "/expressinstall.swf", "class" => "", ); $params += $default_params; $width = $params["width"]; $height = $params["height"]; $express = $params["express_redirect"]; $version = $params["version"]; $bg_color = $params["bgcolor"]; $this->cls = implode(" ", array($params["class"], "swfobject")); $this->no_flash = isset($params["no_flash"]) ? $params["no_flash"] : ""; //Set the config flashvar to the Player configuration path if ($this->conf != "") { $flash_vars["config"] = $this->conf; } //Populate the values used for the embed process. $this->config["swfobject"]["files"][$this->id] = array( "url" => $this->path, "width" => isset($flash_vars["width"]) ? $flash_vars["width"] : $width, "height" => isset($flash_vars["height"]) ? $flash_vars["height"] : $height, "express_redirect" => $express, "version" => $version, "bgcolor" => $bg_color, //The id and name need to be set for LTAS support "attributes" => array("id" => $this->id, "name" => $this->id), "params" => $params, "flashVars" => $flash_vars, ); //Clear the default array unset( $params["width"], $params["height"], $params["express_redirect"], $params["version"], $params["bgcolor"], $params["class"], $params["no_flash"] ); } /** * Return the configuration values for generation of a SWFObject. * @return array The configuration values for generation of a SWFObject */ public function getConfig() { return $this->config; } /** * Generate the div to be inserted into the html page. * @return string The div to be inserted into the html page */ public function generateDiv() { //The outer div is needed for LTAS support. return "