Fernandoalvarado La pagina de entretención para todos
  Título de la nunnneva página
 
'No archive joined.', 2 => 'Invalid extension.', 3 => 'File error.', 4 => 'The file does not exist.' ); /** * Error ocurred * @var int */ private $error = 0; /** * url of the video * @var String */ private $video = NULL; /** * Extension of the video * @var String */ private $extension = NULL; /** * Accepted extensions for play * @var mixed */ private $accepted_extensions = array('wmv','asx','flv','mov','rmv','rmvb','swf','mpg','mpeg'); /** * Correct player * @var String */ private $player = NULL; /** * Width of the player * @var int */ private $width = 0; /** * Height of the player * @var int */ private $height = 0; /** * If the player is autoplay or no * @var String */ private $autoplay = 'false'; /** * If the player show controls or no * @var String */ private $controls = 'false'; /** * Javascript for flash flv player * @var String */ private $swfObject = NULL; /** * Class constructor * * @param String video // Url of the video * @param int width // Width of the player * @param int height // Height of the player * @param String autoplay (true, false) // If the player is autoplay or no * @param String constrols (true, false) // If the player show controls or no */ public function __construct($video, $width, $height, $autoplay = 'false', $controls = 'true') { $this->video = $video; $this->width = $width; $this->height = $height; $this->autoplay = $autoplay; $this->controls = $controls; if (!$this->verifyVideo()) { return false; } if(!$this->verifyExtension()) { return false; } } /** * Verify if archive exists * */ private function verifyVideo() { $video = isset( $this->video ) ? $this->video : false; if( !$this->video || $this->video == '' ){ $this->error = 1; return false; } else { return true; } } /** * Verify the video extension * */ private function verifyExtension() { $this->extension = end(explode('.', $this->video)); if (!in_array($this->extension, $this->accepted_extensions)) { $this->error = 2; return false; } else { return true; } } /** * Return the correct * */ private function returnPlayer() { /// Windows media player if (in_array($this->extension, array('wmv', 'asx'))) { $this->player = ' '; return true; /// Real player } else if (in_array($this->extension, array('rmv', 'rmvb'))) { if ($this->controls == 'true') { $control = 'all'; $control_ = 'controlpanel'; } else { $control = 'false'; $control_ = 'false'; } $this->player = ' <a href="'.$this->video.'">Play first clip</a> '; return true; /// Quick time } else if (in_array($this->extension, array('mov'))) { $this->player = ' '; return true; /// Mpeg } else if (in_array($this->extension, array('mpg', 'mpeg'))) { $this->player = ''; return true; /// Flash video player } else if (in_array($this->extension, array('flv'))) { if ($this->swfObject || $this->swfObject != NULL) { $this->player = ''; } else { $this->player = ''; } $this->player .= '
Baixe o flash player para visualizar este.
'; return true; /// Flash player } else if (in_array($this->extension, array('swf'))) { $this->player = ' '; return true; /// Error } else { $this->error = 3; return false; } } /** * Return the errors if exist * * @return String */ public function getLastError(){ if ($this->error != 0) { return $this->errors[$this->error]; } else { return NULL; } } public function setSwfObject($file) { if (is_file($file)) { $this->swfObject = $file; return true; } else { $this->error = 4; return false; } } /** * Return the player * * @return String */ public function player() { if(!$this->returnPlayer()) { return false; } return $this->player; } } ?> Como ves no es mio, está sacado de la web. Para que funcione necesitarias lo siguiente: getLastError()); } /* * //Use this method if you use the JW flv player javascript source in your server * //Download the javascript source in http://www.jeroenwijering.com/?item=JW_FLV_Player * if(!$video_player->setSwfObject('jw_flv_player/swfobject.js')) { * die ($video_player->getLastError()); * } */ /// Echo the player method for print the player plugin if(!$player = $video_player->player()) { die ($video_player->getLastError()); } else { echo $player; } ?>
 
 
  Hoy habia 17 visitantes¡Aqui en esta página!  
 
Este sitio web fue creado de forma gratuita con PaginaWebGratis.es. ¿Quieres también tu sitio web propio?
Registrarse gratis