コード例 #1
0
ファイル: izap_videos.php プロジェクト: iionly/izap_videos
 /**
  * Gets the video player according to the video type
  *
  * @param int $width width of video player
  * @param int $height height of video player
  * @param int $autoPlay autoplay option (1 | 0)
  * @param string $extraOptions extra options if available
  * @return HTML complete player code
  */
 public function getPlayer($width = 600, $height = 360, $autoPlay = 0, $extraOptions = '')
 {
     $html = '';
     switch ($this->videotype) {
         case 'youtube':
             $html = "<iframe src=\"{$this->videosrc}?rel=0&amp;autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>";
             break;
         case 'vimeo':
             $html = "<iframe src=\"{$this->videosrc}&amp;autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>";
             break;
         case 'dailymotion':
             $html = "<iframe src=\"{$this->videosrc}?autoplay={$autoPlay}\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\" frameborder=\"0\" webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe>";
             break;
         case 'uploaded':
             if ($this->converted == 'yes') {
                 $border_color1 = izapAdminSettings_izap_videos('izapBorderColor1');
                 $border_color2 = izapAdminSettings_izap_videos('izapBorderColor2');
                 $border_color3 = izapAdminSettings_izap_videos('izapBorderColor3');
                 if (!empty($border_color3)) {
                     $extraOptions .= '&btncolor=0x' . $border_color3;
                 }
                 if (!empty($border_color1)) {
                     $extraOptions .= '&accentcolor=0x' . $border_color1;
                 }
                 if (!empty($border_color2)) {
                     $extraOptions .= '&txtcolor=0x' . $border_color2;
                 }
                 $html = "\r\n<object width='" . $width . "' height='" . $height . "' id='flvPlayer'>\r\n<param name='allowFullScreen' value='true'>\r\n<param name='allowScriptAccess' value='always'>\r\n<param name='movie' value='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=off&vTitle=" . $this->title . "&showTitle=yes' >\r\n<embed src='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=off&vTitle=" . $this->title . "&showTitle=yes' width='" . $width . "' height='" . $height . "' allowFullScreen='true' type='application/x-shockwave-flash' allowScriptAccess='always' wmode='transparent'>\r\n</object>";
             } else {
                 $html = elgg_echo('izap_videos:processed');
             }
             break;
         case 'embed':
             $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc);
             break;
     }
     return $html;
 }
コード例 #2
0
ファイル: izap_videos.php プロジェクト: rimpy/izap_videos
 /**
  * gets the video player according to the video type
  *
  * @param int $width width of video player
  * @param int $height height of video player
  * @param int $autoPlay autoplay option (1 | 0)
  * @param string $extraOptions extra options if available
  * @return HTML complete player code
  */
 public function getPlayer($width = 670, $height = 400, $autoPlay = 0, $extraOptions = '')
 {
     global $CONFIG;
     $html = '';
     if (filter_var($this->videosrc, FILTER_VALIDATE_URL)) {
         switch ($this->videotype) {
             case 'youtube':
                 $html = "<object width=\"{$width}\" height=\"{$height}\"><param name=\"movie\" value=\"{$this->videosrc}&hl=en&fs=1&autoplay={$autoPlay}\"></param><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowFullScreen\" value=\"true\"></param><embed src=\"{$this->videosrc}&hl=en&fs=1&autoplay={$autoPlay} \" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\"></embed></object>";
                 break;
             case 'vimeo':
                 $html = "<object width=\"{$width}\" height=\"{$height}\"><param name=\"wmode\" value=\"transparent\"></param><param name=\"allowfullscreen\" value=\"true\" /><param name=\"allowscriptaccess\" value=\"always\" /><param name=\"movie\" value=\"{$this->videosrc}&amp;autoplay={$autoPlay}\" /><embed src=\"{$this->videosrc}&amp;autoplay={$autoPlay}\" type=\"application/x-shockwave-flash\" allowfullscreen=\"true\" allowscriptaccess=\"always\" width=\"{$width}\" height=\"{$height}\" wmode=\"transparent\"></embed></object>";
                 break;
             case 'veoh':
                 $html = "<embed src=\"{$this->videosrc}&videoAutoPlay={$autoPlay}\" allowFullScreen=\"true\" width=\"{$width}\" height=\"{$height}\" bgcolor=\"#FFFFFF\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" wmode=\"transparent\"></embed>";
                 break;
             case 'uploaded':
                 if ($this->converted == 'yes') {
                     $border_color1 = izapAdminSettings_izap_videos('izapBorderColor1');
                     $border_color2 = izapAdminSettings_izap_videos('izapBorderColor2');
                     $border_color3 = izapAdminSettings_izap_videos('izapBorderColor3');
                     if (!empty($border_color3)) {
                         $extraOptions .= '&btncolor=0x' . $border_color3;
                     }
                     if (!empty($border_color1)) {
                         $extraOptions .= '&accentcolor=0x' . $border_color1;
                     }
                     if (!empty($border_color2)) {
                         $extraOptions .= '&txtcolor=0x' . $border_color2;
                     }
                     $html = "\r\n           <object width='" . $width . "' height='" . $height . "' id='flvPlayer'>\r\n            <param name='allowFullScreen' value='true'>\r\n             <param name='allowScriptAccess' value='always'>\r\n            <param name='movie' value='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=on&vTitle=" . $this->title . "&showTitle=yes' >\r\n            <embed src='" . $this->IZAPSETTINGS->playerPath . "?movie=" . $this->videosrc . $extraOptions . "&volume=30&autoload=on&autoplay=on&vTitle=" . $this->title . "&showTitle=yes' width='" . $width . "' height='" . $height . "' allowFullScreen='true' type='application/x-shockwave-flash' allowScriptAccess='always' wmode='transparent'>\r\n           </object>";
                 } else {
                     $html = elgg_echo('izap_videos:processed');
                 }
                 break;
             case 'embed':
             case 'others':
                 $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc);
                 break;
         }
     } else {
         $html = izapGetReplacedHeightWidth_izap_videos($height, $width, $this->videosrc);
     }
     return $html;
 }