Example #1
0
    assign('cb_vjs_player_dir', CB_VJS_PLAYER_DIR);
    assign('cb_vjs_player_url', CB_VJS_PLAYER_URL);
    function cb_video_js($in)
    {
        global $cb_video_js;
        $cb_video_js = true;
        $vdetails = $in['vdetails'];
        $video_play = get_video_files($vdetails, true, true);
        if (!strstr($in['width'], "%")) {
            $in['width'] = $in['width'] . 'px';
        }
        if (!strstr($in['height'], "%")) {
            $in['height'] = $in['height'] . 'px';
        }
        assign('height', $in['height']);
        assign('width', $in['width']);
        assign('player_config', $in);
        assign('vdata', $vdetails);
        assign('cb_logo', cb_logo());
        assign('video_files', $video_play);
        Template(CB_VJS_PLAYER_DIR . '/cb_video_js.html', false);
        return true;
    }
    function cb_logo()
    {
        $l_details = BASEURL . '/images/icons/country/hp-cb.png';
        $l_convert = base64_encode(file_get_contents($l_details));
        return $l_convert;
    }
    register_actions_play_video('cb_video_js');
}
Example #2
0
        }
        if (!$vdetails['embed_code'] || $vdetails['embed_code'] == 'none' || $ytcode) {
            $code = '<embed src="' . $embed_src . '" type="application/x-shockwave-flash"';
            $code .= 'allowscriptaccess="always" allowfullscreen="true"  ';
            $code .= 'width="' . config("embed_player_width") . '" height="' . config("embed_player_height") . '"></embed>';
            return $code;
        } else {
            return false;
        }
    }
    /**
     * Writing CB Player function to play videos on facebook
     */
    function cb_facebook_embed($params)
    {
        $vdetails = $params['video'];
        $config = urlencode(BASEURL . "/player/" . CB_PLAYER . "/embed_player.php?vid=" . $vdetails['videoid'] . "&autoplay=" . config('autoplay_embed'));
        $embed_src = BASEURL . '/player/' . CB_PLAYER . '/player.swf?config=' . $config;
        return $embed_src;
    }
    register_embed_function('cbplayer_embed_src');
    register_actions_play_video('cb_player');
    cb_register_function('cb_facebook_embed', 'fb_embed_video');
    //include Pak Player JS File
    $Cbucket->add_header(CB_PLAYER_DIR . '/cbplayer_header.html');
    $Cbucket->add_admin_header(CB_PLAYER_DIR . '/cbplayer_header.html');
    /**
     * Including plugin files 
     */
    include "cbplayer.plugin.php";
}
Example #3
0
     *
     * @param video details
     * @return src link
     */
    function pakplayer_embed_src($vdetails)
    {
        $config = urlencode(BASEURL . "/player/pak_player/embed_player.php?vid=" . $vdetails['videoid'] . "&json=true&autoplay=" . config('autoplay_embed'));
        if (!config('pak_license')) {
            $embed_src = BASEURL . '/player/pak_player/pakplayer.swf?config=' . $config;
        } else {
            $embed_src = BASEURL . '/player/pak_player/pakplayer.unlimited.swf?config=' . $config;
        }
        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 (!$vdetails['embed_code'] || $vdetails['embed_code'] == 'none' || $ytcode) {
            $code = '<embed src="' . $embed_src . '" type="application/x-shockwave-flash"';
            $code .= 'allowscriptaccess="always" allowfullscreen="true"  ';
            $code .= 'width="' . config("embed_player_width") . '" height="' . config("embed_player_height") . '"></embed>';
            return $code;
        } else {
            return false;
        }
    }
    register_embed_function('pakplayer_embed_src');
    register_actions_play_video('pak_player');
    //include Pak Player JS File
    $Cbucket->add_header(PAK_PLAYER_DIR . '/pplayer_head.html');
    $Cbucket->add_admin_header(PAK_PLAYER_DIR . '/pplayer_head.html');
}
Example #4
0
        preg_match("/youtube-nocookie\\.com/", $src, $ytnccom);
        if (!empty($ytcom[0]) || !empty($ytnccom[0])) {
            preg_match("/\\/v\\/([a-zA-Z0-9_-]+)/", $src, $srcs);
            $srcs = explode("&", $srcs[1]);
            $ytcode = $srcs[0];
            if (!$ytcode) {
                preg_match("/\\/embed\\/(.*)/", $src, $srcs);
                $srcs = explode("&", $srcs[1]);
                $ytcode = $srcs[0];
            }
            //Creating Youtube VIdeo URL
            $yturl = "http://www.youtube.com/watch?v=" . $ytcode;
            $results['url'] = $yturl;
            $results['ytcode'] = $ytcode;
            $results['website'] = 'youtube';
            return $results;
        } else {
            return false;
        }
    }
    //If Youtube
    function is_ref_youtube($url)
    {
        preg_match("/youtube\\.com/", $url, $ytcom);
        return $ytcom;
    }
    register_after_video_upload_action('embed_video_check');
    register_custom_upload_field($embed_field_array);
    $Cbucket->add_header(PLUG_DIR . '/embed_video_mod/header.html');
    register_actions_play_video('play_embed_video');
}
Example #5
0
            }
            Template(HTML5_PLAYER_DIR . '/html5_player.html', false);
            return true;
        }
    }
    // function used to get quality of a file
    function get_quality($file)
    {
        $quality = explode('-', $file);
        $quality = end($quality);
        $quality = explode('.', $quality);
        $quality = $quality[0];
        return $quality;
    }
    // function used to index the video files array as 240,360....
    function process_app_videos($array)
    {
        $video_files = $array;
        $results = array();
        foreach ($video_files as $key => $file) {
            $quality = get_quality($file);
            $results[$quality] = $file;
        }
        return $results;
    }
    register_actions_play_video('html5_player');
}
//overlay
/*$ov_details = BASEURL.'/images/icons/country/ov.png';
  $ov_convert = base64_encode(file_get_contents($ov_details));
  assign('ov',$ov_convert);*/