Example #1
0
 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['video'];
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     $files = $in['files'];
     if ($files) {
         foreach ($files as $key => $file) {
             if ($key == 'flv' || $key == 'mp4' || $key == 'mobile') {
                 $video_file = $file;
                 break;
             }
             if ($file['status'] == 's' && $file['is_original'] != 'yes') {
                 $video_file = VIDEOS_URL . '/' . $file['file_directory'] . '/';
                 $video_file .= $file['file_name'] . $file['suffix'] . '.' . $file['ext'];
                 break;
             }
         }
     }
     if ($video_file || $ytcode) {
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $video_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         $player = fetch(CB_PLAYER_DIR . '/cbplayer.html', false);
         return $player;
     }
 }
Example #2
0
 function cb_player($in)
 {
     global $cb_player;
     $cb_player = true;
     $vdetails = $in['vdetails'];
     $vid_file = get_video_file($vdetails, true, true);
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($vid_file || $ytcode) {
         $hd = $data['hq'];
         if ($hd == 'yes') {
             $file = get_hq_video_file($vdetails);
         } else {
             $file = get_video_file($vdetails, true, true);
         }
         $hd_file = get_hq_video_file($vdetails);
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && ($_GET['play_list'] || $_GET['playlist'])) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         assign('logo_placement', cb_player_logo_position());
         assign('logo_margin', config('logo_padding'));
         //Setting Skin
         assign('cb_skin', 'glow/glow.xml');
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $vid_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         Template(CB_PLAYER_DIR . '/cbplayer.html', false);
         return true;
     }
 }
Example #3
0
subtitle($title);
?>

<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
<title><?php 
echo cbtitle();
?>
</title>
<link><?php 
echo BASEURL;
?>
</link>
    <image> 
        <url><?php 
echo website_logo();
?>
</url>
        <link><?php 
echo BASEURL;
?>
</link>
        <title><?php 
echo cbtitle();
?>
</title>
    </image>
    <description><?php 
echo $Cbucket->configs['description'];
?>
</description>
Example #4
0
 /**
  * this function will play pak player
  * @param : $in ARRAY 
  * array('vdetails' [all video details])
  */
 function pak_player($in)
 {
     global $pak_player;
     $pak_player = true;
     $vdetails = $in['vdetails'];
     $vid_file = get_video_file($vdetails, true, true);
     //Checking for YT Referal
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($vdetails['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($vid_file || $ytcode) {
         $hd = $data['hq'];
         if ($hd == 'yes') {
             $file = get_hq_video_file($vdetails);
         } else {
             $file = get_video_file($vdetails, true, true);
         }
         $hd_file = get_hq_video_file($vdetails);
         if ($ytcode) {
             assign('youtube', true);
             assign('ytcode', $ytcode);
         }
         if (!strstr($in['width'], "\\%")) {
             $in['width'] = $in['width'] . 'px';
         }
         if (!strstr($in['height'], "\\%")) {
             $in['height'] = $in['height'] . 'px';
         }
         if ($in['autoplay'] == 'yes' || $in['autoplay'] === true || $_COOKIE['auto_play_playlist'] && $_GET['playlist']) {
             $in['autoplay'] = true;
         } else {
             $in['autoplay'] = false;
         }
         //Logo Placement
         $placement = config('logo_placement');
         switch ($placement) {
             case "tl":
                 assign('logo_top', '5');
                 assign('logo_left', '5');
                 assign('logo_position', 'top:5,left:5');
                 break;
             case "tr":
                 assign('logo_top', '5');
                 assign('logo_right', '5');
                 assign('logo_position', 'top:5,right:5');
                 break;
             case "br":
                 assign('logo_bottom', '5');
                 assign('logo_right', '5');
                 assign('logo_position', 'bottom:5,right:5');
                 break;
             case "bl":
                 assign('logo_bottom', '5');
                 assign('logo_left', '5');
                 assign('logo_position', 'bottom:5,left:5');
                 break;
         }
         assign('player_data', $in);
         assign('player_logo', website_logo());
         assign('normal_vid_file', $vid_file);
         assign("hq_vid_file", $hd_file);
         assign('vdata', $vdetails);
         assign('pakplayer', 'yes');
         assign('updateEmbedCode', 'updateEmbedCode');
         Template(PAK_PLAYER_DIR . '/player.html', false);
         return true;
     }
 }
Example #5
0
 function embed_video_src($params)
 {
     $pseudo_streaming = false;
     $ppfile = 'pakplayer.swf';
     if (config('pak_license')) {
         $ppfile = 'pakplayer.unlimited.swf';
     }
     $video = $params['video'];
     $array = array();
     $plugins['controls']['url'] = BASEURL . '/player/pak_player/pakplayer.controls.swf';
     $plugins['controls']['background'] = 'url(' . BASEURL . '/player/pak_player/bg.png) repeat';
     $canvas['backgroundColor'] = "#000000";
     $canvas['backgroundGradient'] = "none";
     /* Checking for youtube */
     $ref = $video['refer_url'];
     //Trying other method
     if (function_exists('get_refer_url_from_embed_code')) {
         $ref_details = get_refer_url_from_embed_code(unhtmlentities(stripslashes($video['embed_code'])));
         $ytcode = $ref_details['ytcode'];
     }
     if ($ytcode) {
         $plugins['youtube']['url'] = BASEURL . '/player/pak_player/pakplayer.youtube.swf';
         $plugins['youtube']['enableGdata'] = true;
         $clip['url'] = 'api:' . $ytcode;
         $clip['provider'] = 'youtube';
         $clip['urlResolvers'] = 'youtube';
     } else {
         if (config('pseudostreaming') == 'yes') {
             $plugins['pseudo']['url'] = BASEURL . '/player/pak_player/pakplayer.pseudo.swf';
             $clip['provider'] = 'pseudo';
             $pseudo_streaming = true;
         }
         $clip['url'] = get_video_file($video, true, true);
     }
     /* End Checking Youtube */
     // Setting AutoPlay
     if ($_GET['autoplay']) {
         $autoplay = $_GET['autoplay'];
     } else {
         $autoplay = $_GET['autoplay_embed'];
     }
     if ($autoplay == 'yes') {
         $autoplay = true;
     } else {
         $autoplay = false;
     }
     $clip['scaling'] = 'fit';
     $clip['autoPlay'] = $autoplay;
     $clip['linkUrl'] = videoLink($video);
     $clip['linkWindow'] = '_blank';
     $logo['url'] = website_logo();
     $logo['fullscreenOnly'] = false;
     $logoPlace = config('logo_placement');
     $padding = config('logo_padding');
     switch ($logoPlace) {
         case "tr":
             $logo['top'] = $padding;
             $logo['right'] = $padding;
             break;
         case "tl":
             $logo['top'] = $padding;
             $logo['left'] = $padding;
             break;
         case "br":
             $logo['bottom'] = $padding;
             $logo['right'] = $padding;
             break;
         case "bl":
             $logo['bottom'] = $padding;
             $logo['left'] = $padding;
             break;
     }
     $logo['opacity'] = 0.4;
     $logo['linkUrl'] = videoLink($video);
     $array['key'] = config("pak_license");
     $array['plugins'] = $plugins;
     $array['canvas'] = $canvas;
     $array['clip'] = $clip;
     $array['contextMenu'][][config("pakplayer_contextmsg")] = "";
     $array['logo'] = $logo;
     if (!$params['only_configs']) {
         return BASEURL . '/player/pak_player/' . $ppfile . '?config=' . json_encode($array);
     } else {
         return json_encode($array);
     }
 }