Exemplo n.º 1
0
/**
 * Function used to display flash player for ClipBucket video
 */
function flashPlayer($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $flv = $param['flv'] . '.flv';
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    $param['enlarge_button'] = config('enlarge_button');
    $param['player_logo_url'] = config('player_logo_url');
    //dump($code);
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    assign('player_params', $param);
    if (count($Cbucket->actions_play_video) > 0) {
        foreach ($Cbucket->actions_play_video as $funcs) {
            if (function_exists($funcs)) {
                $func_data = $funcs($param);
            }
            if ($func_data) {
                $player_code = $func_data;
                $show_player = true;
                break;
            }
        }
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    } elseif (function_exists('cbplayer')) {
        return $player_code;
    }
    global $pak_player;
    if ($player_code) {
        if (!$pak_player && $show_player && !is_bool($player_code)) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}
Exemplo n.º 2
0
/**
 * Loads ClipBucket players...
 * 
 * @global type $Cbucket
 * @global type $swfobj
 * @param type $param
 * @return boolean
 * 
 * @todo Write documentation on this function..
 */
function cb_video_player($param)
{
    global $Cbucket, $swfobj;
    $param['player_div'] = $param['player_div'] ? $param['player_div'] : 'videoPlayer';
    $key = $param['key'];
    $code = $param['code'];
    $flv_url = $file;
    $embed = $param['embed'];
    $code = $param['code'];
    $height = $param['height'] ? $param['height'] : config('player_height');
    $width = $param['width'] ? $param['width'] : config('player_width');
    $param['height'] = $height;
    $param['width'] = $width;
    if (!$param['autoplay']) {
        $param['autoplay'] = config('autoplay_video');
    }
    if (!$param['files']) {
        global $cbvid;
        $files = $cbvid->get_video_files($param['video']);
        $param['files'] = $files;
    }
    assign('player_params', $param);
    $param = apply_filters($param, 'play_video');
    //Calling actions for play_video
    $output = call_actions('play_video', $param);
    if ($output) {
        $player_code = $output;
        return $output;
    }
    if (function_exists('cbplayer') && empty($player_code)) {
        $player_code = cbplayer($param, true);
    }
    if ($player_code) {
        if (!$pak_player && $show_player) {
            assign("player_js_code", $player_code);
            Template(PLAYER_DIR . '/player.html', false);
            return false;
        } else {
            return false;
        }
    }
    return blank_screen($param);
}