Exemplo n.º 1
0
 function get_mob_video($params)
 {
     $vdo = $params['video'];
     $assign = $params['assign'];
     $vid_file = get_video_file($vdo, true, true);
     $vidfile = substr($vid_file, 0, strlen($vid_file) - 4) . '-m.mp4';
     assign($assign, $vidfile);
     if ($vidfile) {
         return $vidfile;
     }
 }
Exemplo n.º 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;
     }
 }
Exemplo n.º 3
0
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
if (@$_GET['msg']) {
    $msg[] = clean($_GET['msg']);
}
$video = mysql_clean($_GET['video']);
//Check Video Exists or Not
if ($myquery->VideoExists($video)) {
    # Setting Default thumb
    if (isset($_POST['update_default_thumb'])) {
        $myquery->set_default_thumb($video, $_POST['default_thumb']);
    }
    $data = get_video_details($video);
    #pr($data,true);
    $vid_file = VIDEOS_DIR . '/' . $data['file_directory'] . '/' . get_video_file($data, false, false);
    # Uploading Thumbs
    if (isset($_POST['upload_thumbs'])) {
        if ($data['files_thumbs_path'] != '') {
            $files_thumbs_path = $data['files_thumbs_path'];
            $serverApi = str_replace('/files/thumbs', '', $files_thumbs_path);
            $serverApi = $serverApi . '/actions/custom_thumb_upload.php';
            $file_thumb = $_FILES['vid_thumb']['tmp_name'][0];
            $postvars['mode'] = 'add';
            $postvars['file_thumb'] = "@" . $file_thumb;
            $postvars['files_thumbs_path'] = $files_thumbs_path;
            $postvars['file_directory'] = $data['file_directory'];
            $postvars['file_name'] = $data['file_name'];
            $postvars['duration'] = $data['duration'];
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $serverApi);
Exemplo n.º 4
0
 /**
  * Function used to check weather video is downloadable or not
  */
 function downloadable($vdo)
 {
     $file = get_video_file($vdo, false);
     if ($file) {
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 5
0
    ?>
<url>
<loc><?php 
    echo video_link($video);
    ?>
</loc>
<video:video>
<video:content_loc><?php 
    echo get_video_file($video);
    ?>
</video:content_loc>
<video:player_loc allow_embed="yes"><?php 
    echo BASEURL;
    ?>
/player/old_players/embed_player.swf?file=<?php 
    echo get_video_file($video);
    ?>
</video:player_loc>
<video:thumbnail_loc><?php 
    echo get_thumb($video);
    ?>
</video:thumbnail_loc>
<video:title><![CDATA[<?php 
    echo substr($video['title'], 0, 50);
    ?>
]]></video:title>
<video:description><![CDATA[<?php 
    echo substr($video['description'], 0, 300);
    ?>
]]></video:description>
<video:rating><?php 
Exemplo n.º 6
0
 /**
  * Function used to play embed code
  * @param Video details
  */
 function play_embed_video($data)
 {
     global $swfobj;
     $vdetails = $data['vdetails'];
     $file = get_video_file($vdetails, false, false);
     if (!$file || $file == 'no_video.flv') {
         if (!empty($vdetails['embed_code']) && $vdetails['embed_code'] != 'none') {
             $embed_code = $vdetails['embed_code'];
             //Replacing Height And Width
             $h_w_p = array("{Width}", "{Height}");
             $h_w_r = array($data['width'], $data['height']);
             $embed_code = str_replace($h_w_p, $h_w_r, $embed_code);
             $embed_code = unhtmlentities($embed_code);
             $embed_code = preg_replace('/<b>(.*<\\/b>)?/', '', $embed_code);
             //Checking for REF CODE , if its youtube, add AUTOPLAY accordingly)
             $ref = get_refer_url_from_embed_code($embed_code);
             if (!empty($ref) && $ref['website'] == "youtube") {
                 //Add AutoPlay
                 if (config("autoplay_video") == "yes") {
                     $autoplay = 1;
                 } else {
                     $autoplay = 0;
                 }
                 $embed_code = preg_replace("/src=\"(.*)\"/Ui", "src=\"\$1&autoplay=" . $autoplay . "\"", $embed_code);
             }
             preg_match('/http:\\/\\/www\\.youtube\\.com\\/v\\/([a-zA-Z0-9_-]+)/', $embed_code, $ytmatches);
             $ytCode = $ytmatches[1];
             if (!$ytCode) {
                 preg_match('/http:\\/\\/www\\.youtube\\.com\\/embed\\/([a-zA-Z0-9_-]+)/', $embed_code, $ytmatches);
                 $ytCode = $ytmatches[1];
             }
             if (YOUTUBE_ENABLED == 'yes' && $ytCode) {
                 assign('youtube', $ytCode);
                 assign('ytcode', $ytCode);
                 return false;
             }
             echo $embed_code;
             return true;
             //$swfobj->EmbedCode($embed_code,$data['player_div']);
             //return $swfobj->code;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 7
0
 /**
  * Function used to play embed code
  * @param Video details
  */
 function play_embed_video($data)
 {
     global $swfobj;
     $vdetails = $data['vdetails'];
     $file = get_video_file($vdetails, false, false);
     if (!$file || $file == 'no_video.flv') {
         if (!empty($vdetails['embed_code']) && $vdetails['embed_code'] != 'none') {
             $embed_code = $vdetails['embed_code'];
             //Replacing Height And Width
             $h_w_p = array("{Width}", "{Height}");
             $h_w_r = array($data['width'], $data['height']);
             $preg_match = array('/<b>(.*<\\/b>)?/', '/width\\: ?([0-9]+)px/', '/height: ?([0-9]+)px/', '/width=([0-9]+)/', '/height=([0-9]+)/');
             $width_px_replace = $data['width'] . 'px';
             $height_px_replace = $data['height'] . 'px';
             $width_replace = $data['width'];
             $height_replace = $data['height'];
             if (strstr($data['width'], '%')) {
                 $width_px_replace = $data['width'];
             }
             if (strstr($data['height'], '%')) {
                 $height_px_replace = $data['height'];
             }
             $preg_repalce = array('', 'width=' . $width_replace, 'height=' . $height_replace);
             /*$embed_code = str_replace($h_w_p, $h_w_r, $embed_code);   
               $embed_code = preg_replace($preg_match, $preg_repalce, $embed_code); */
             $iframe = $vdetails['embed_code'];
             $iframe = str_replace('height=', 'height="' . $data['height'] . '"', $iframe);
             $iframe = str_replace('width=', 'width="' . $data['width'] . '"', $iframe);
             $embed_code = $iframe;
             $embed_code = str_replace('href=', 'style="display:none;"', $embed_code);
             $embed_code = str_replace('by', '', $embed_code);
             $embed_code = unhtmlentities($embed_code);
             /*
             
             //Checking for REF CODE , if its youtube, add AUTOPLAY accordingly)
             $ref = get_refer_url_from_embed_code($embed_code);
             if (!empty($ref) && $ref['website'] == "youtube")
             {
                 //Add AutoPlay
                 if (config("autoplay_video") == "yes")
                     $autoplay = 1;
                 else
                     $autoplay = 0;
                 $embed_code = preg_replace("/src=\"(.*)\"/Ui", "src=\"$1&autoplay=" . $autoplay . "\"", $embed_code);
             }
             
             preg_match('/http:\/\/www\.youtube\.com\/v\/([a-zA-Z0-9_-]+)/', $embed_code, $ytmatches);
             
             $ytCode = $ytmatches[1];
             
             if (!$ytCode)
             {
                 preg_match('/http:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9_-]+)/', $embed_code, $ytmatches);
                 $ytCode = $ytmatches[1];
             }
             
             if (YOUTUBE_ENABLED == 'yes' && $ytCode)
             {
                 assign('youtube', $ytCode);
                 assign('ytcode', $ytCode);
                 return false;
             }
             */
             $swfobj->EmbedCode($embed_code, $data['player_div']);
             //return $embed_code;
             return $swfobj->code;
         }
     } else {
         return false;
     }
 }
Exemplo n.º 8
0
require '../includes/admin_config.php';
$userquery->admin_login_check();
$userquery->login_check('video_moderation');
$pages->page_redir();
if (@$_GET['msg']) {
    $msg[] = clean($_GET['msg']);
}
$video = mysql_clean($_GET['video']);
//Check Video Exists or Not
if ($myquery->VideoExists($video)) {
    # Setting Default thumb
    if (isset($_POST['update_default_thumb'])) {
        $myquery->set_default_thumb($video, $_POST['default_thumb']);
    }
    $data = get_video_details($video);
    $vid_file = VIDEOS_DIR . '/' . get_video_file($data, false, false);
    # Uploading Thumbs
    if (isset($_POST['upload_thumbs'])) {
        $Upload->upload_thumbs($data['file_name'], $_FILES['vid_thumb']);
    }
    //	# Uploading Big Thumb
    //	if(isset($_POST['upload_big_thumb'])) {
    //		$Upload->upload_big_thumb($data['file_name'],$_FILES['big_thumb']);
    //	}
    # Delete Thumb
    if (isset($_GET['delete'])) {
        delete_video_thumb($_GET['delete']);
    }
    # Generating more thumbs
    if (isset($_GET['gen_more'])) {
        $num = config('num_thumbs');
Exemplo n.º 9
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;
     }
 }
Exemplo n.º 10
0
<?php

define("CLEAN_BASEURL", "/\\/player\\/cbplayer/");
include "../../includes/config.inc.php";
$vid = $_GET['vid'];
//gettin video details
$vdetails = get_video_details($vid);
if (!$vdetails) {
    exit(json_encode(array("err" => "no video details found")));
}
header('Content-Type: text/xml');
$video = $vdetails;
//Loading video files
$vid_file = get_video_file($vdetails, true, true);
$hd_file = get_hq_video_file($vdetails, false);
/* 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'];
}
?>
<config>

  <?php 
if (!$ytcode) {
    ?>
  <file><?php 
    echo $vid_file;
    ?>
Exemplo n.º 11
0
/**
 * FUnction used to get HQ ie mp4 video
 */
function get_hq_video_file($vdetails, $return_default = true)
{
    return get_video_file($vdetails, $return_default, true, false, false, true);
}
Exemplo n.º 12
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);
     }
 }
Exemplo n.º 13
0
 * Function : Download video
 * @author : Arslan Hassan
 * @Software : ClipBucket
 * @Since : 1 Feb, 2010
 *
 * @License : Attribution Assurance License -- http://www.opensource.org/licenses/attribution.php
 */
define("THIS_PAGE", 'download');
define("PARENT_PAGE", 'videos');
require 'includes/config.inc.php';
$userquery->perm_check('download_video', true);
$pages->page_redir();
//Getting Video Key
$vkey = @$_GET['v'];
$vdo = $cbvid->get_video($vkey);
if ($vdo && video_playable($vkey)) {
    //Calling Functions When Video Is going to download
    call_download_video_function($vdo);
    $file = get_video_file($vdo, false);
    if ($file) {
        $vdo['download_file'] = $file;
    } else {
        $Cbucket->show_page = false;
        e(lang("unable_find_download_file"));
    }
    assign('vdo', $vdo);
    subtitle("Download " . $vdo['title']);
}
//Displaying The Template
template_files('download.html');
display_it();