예제 #1
0
 /**
  * Generates embed code properties
  * 
  * @param ARRAY vdetails
  * @return ARRAY emebd_code_detailss
  */
 function embed_code_props($vdetails, $type = 'embed_object')
 {
     //Checking for video details
     if (!is_array($vdetails)) {
         $vdetails = $this->get_video($vdetails);
     }
     $embed_code = false;
     $funcs = $this->embed_func_list;
     if (is_array($funcs)) {
         foreach ($funcs as $func) {
             if (@function_exists($func)) {
                 $embed_code = $func($vdetails);
             }
             if ($embed_code) {
                 break;
             }
         }
     }
     if ($type == 'iframe') {
         //Setting up an array in case we dont want an echo
         //we can give array-output to re-use code even with jS
         $code_props = array();
         $code_props['type'] = 'iframe';
         $code_props['configs']['width'] = config('embed_player_width');
         $code_props['configs']['height'] = config('embed_player_height');
         $code_props['src']['url'] = BASEURL . '/player/embed_player.php';
         $code_props['src']['params'] = array('vid' => $vdetails['videoid'], 'height' => config('embed_player_height'), 'width' => config('embed_player_width'), 'autoplay' => config('autoplay_embed'));
         $code_props['params'] = array('height' => config('embed_player_height'), 'width' => config('embed_player_width'), 'frameborder' => 0, 'allowfullscreen' => true);
         return $code_props;
     }
     //Default ClipBucket Embed Code
     if (function_exists('default_embed_code')) {
         $code_props = default_embed_code($vdetails);
     } else {
         //return new Embed Code
         $embed_code = $vdetails['embed_code'];
         if (!$embed_code || $embed_code == 'none') {
             $code_props = array();
             $code_props['type'] = 'embed_object';
             $code_props['src']['url'] = PLAYER_URL . '/embed_player.php';
             $code_props['src']['params'] = array('vid' => $vdetails['videoid']);
             $code_props['params'] = array('width' => EMBED_VDO_WIDTH, 'height' => EMBED_VDO_HEIGHT, 'allowfullscreen' => true, 'allowscriptaccess' => 'always');
         } else {
             $code_props['type'] = 'embeded';
             $code_props['src'] = embeded_code($vdetails);
         }
     }
     return $code_props;
 }
예제 #2
0
 /**
  * Function used to generate Embed Code
  */
 function embed_code($vdetails, $type = 'embed_object')
 {
     //Checking for video details
     if (!is_array($vdetails)) {
         $vdetails = $this->get_video($vdetails);
     }
     $embed_code = false;
     $funcs = $this->embed_func_list;
     if (is_array($funcs)) {
         foreach ($funcs as $func) {
             if (@function_exists($func)) {
                 $embed_code = $func($vdetails);
             }
             if ($embed_code) {
                 break;
             }
         }
     }
     if ($type == 'iframe') {
         $embed_code = '<iframe width="' . config('embed_player_width') . '" height="' . config('embed_player_height') . '" ';
         $embed_code .= 'src="' . BASEURL . '/player/embed_player.php?vid=' . $vdetails['videoid'] . '&width=' . config('embed_player_width') . '&height=' . config('embed_player_height') . '&autoplay=' . config('autoplay_embed') . '" frameborder="0" allowfullscreen></iframe>';
     }
     if (!$embed_code) {
         //Default ClipBucket Embed Code
         if (function_exists('default_embed_code')) {
             $embed_code = default_embed_code($vdetails);
         } else {
             //return new Embed Code
             $vid_file = get_video_file($vdetails, false, false);
             if ($vid_file) {
                 $code = '';
                 $code .= '<object width="' . EMBED_VDO_WIDTH . '" height="' . EMBED_VDO_HEIGHT . '">';
                 $code .= '<param name="movie" value="' . PLAYER_URL . '/embed_player.php?vid=' . $vdetails['videoid'] . '"></param>';
                 $code .= '<param name="allowFullScreen" value="true"></param>';
                 $code .= '<param name="allowscriptaccess" value="always"></param>';
                 $code .= '<embed src="' . PLAYER_URL . '/embed_player.php?vid=' . $vdetails['videoid'] . '"';
                 $code .= 'type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="300" height="250"></embed>';
                 return $code .= '</object>';
             } else {
                 return embeded_code($vdetails);
             }
         }
     }
     return $embed_code;
 }