ADDED : JW PLayer Smart

This commit is contained in:
Arslan Hassan 2010-04-28 09:46:24 +00:00
parent 366daec592
commit cad8f0359e
9 changed files with 275 additions and 0 deletions

View file

@ -0,0 +1,115 @@
<?php
/*
Player Name: JW Player Smart
Description: Jw Player Smart Player fro ClipBucket v2
Author: Arslan Hassan
ClipBucket Version: 2
Plugin Version: 1.0 - JW 5
Website: http://clip-bucket.com/
*/
/**
* This file is used to instruct ClipBucket
* for how to operate JW PLayer
* from docs.clip-bucket.com
*
* @Author : Arslan Hassan
* @Script : ClipBucket v2
* @License : CBLA
* @Since : Febraury 24, 2010
*/
if(!function_exists("jw_smart"))
{
function jw_smart($data)
{
$vdata = $data['vdetails'];
global $swfobj,$cb_jw_smart;
//Getting Video File
$vid_file = get_video_file($vdata,$no_video,false);
//Checking for YT Referal
$ref = $vdata['refer_url'];
//Checking for youtube
if(function_exists('is_ref_youtube'))
$ytcom = is_ref_youtube($ref);
if($ytcom)
$is_youtube = true;
else
$is_youtube = false;
if($vid_file || $is_youtube)
{
$hd = $data['hq'];
$swfobj->width = $data['width'];
$swfobj->height = $data['height'];
$swfobj->playerFile = PLAYER_URL.'/jw_smart/player-viral.swf';
$swfobj->DivId = $data['player_div'] ? $data['player_div'] : config('player_div_id');
$swfobj->FlashObj();
//Writing Param
$swfobj->addParam('allowfullscreen','true');
$swfobj->addParam('allowscriptaccess','always');
$swfobj->addParam('wmode','opaque');
if($hd=='yes') $file = get_hq_video_file($vdata); else $file = get_video_file($vdata,true,true);
$hd_file = get_hq_video_file($vdata);
if($cb_jw_smart)
{
//Setting Skin
if($cb_jw_smart->configs['jw_skin'])
$swfobj->addVar('skin',$cb_jw_smart->skin($cb_jw_smart->configs['jw_skin']));
//Adding Longtail Add Solution
if($cb_jw_smart->configs['longtail_enabled']=='yes')
{
if(!empty($cb_jw_smart->configs['plugin_var']))
$cb_jw_smart->configs['plugin_var'] .= ',';
$cb_jw_smart->configs['plugin_var'] .= 'ltas';
$swfobj->addVar('ltas.cc',$cb_jw_smart->configs['longtail_id']);
}
//Setting Plugin Vars
if($cb_jw_smart->configs['plugin_var'])
$swfobj->addVar('plugins',$cb_jw_smart->configs['plugin_var']);
//Calling For Custom Variables
$vars = $cb_jw_smart->json_to_custom($cb_jw_smart->configs['custom_variables']);
if(is_array($vars))
{
foreach($vars as $name=>$value)
{
//Replacing Some Files
$vars = array('/video_file/','/hd_file/');
$cb_vars = array($file,$hd_file);
$swfobj->addVar($name,preg_replace($vars,$cb_vars,$value));
}
}
//Setting up the logo
$swfobj->addVar('logo.file',website_logo());
$swfobj->addVar('logo.link ',BASEURL);
$swfobj->addVar('logo.position',$cb_jw_smart->configs['logo_placement']);
}
if($vid_file)
$swfobj->addVar('file',$file);
else
$swfobj->addVar('file',urlencode($ref));
$swfobj->CreatePlayer();
return $swfobj->code;
}else
return false;
}
add_js(array('swfobject.obj.js'=>'global'));
register_actions_play_video('jw_smart');
}
?>

Binary file not shown.

View file

@ -0,0 +1,56 @@
<?php
require('../../includes/common.php');
?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<title>Example XSPF playlist</title>
<tracklist>
<?php
$playlist = $_GET['playlist'];
$playlist = explode('_',$playlist);
$pid = $playlist[0];
$vid = $playlist[1];
$playlist = $cbvid->get_playlist_items(mysql_clean($pid));
if($playlist)
{
foreach($playlist as $video)
{
if($vid==$video['videoid'])
{
?>
<track>
<title><?=$video['title']?></title>
<info><?=videoLink($video)?></info>
<annotation><?=$video['description']?></annotation>
<creator><?=$video['username']?></creator>
<location><?=get_video_file($video,true,true)?></location>
<image><?=getThumb($video)?></image>
</track>
<?php
}
}
foreach($playlist as $video)
{
if($vid!=$video['videoid'])
{
?>
<track>
<title><?=$video['title']?></title>
<info><?=videoLink($video)?></info>
<annotation><?=$video['description']?></annotation>
<creator><?=$video['username']?></creator>
<location><?=videoLink($video)?></location>
<image><?=getThumb($video)?></image>
<provider>html</provider>
</track>
<?php
}
}
}
?>
</tracklist>
</playlist>

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.1 KiB

Binary file not shown.

View file

@ -0,0 +1,26 @@
<?php
$videoid=$_GET["v"];
$format = 18;
$content= file_get_contents("http://youtube.com/get_video_info?video_id=$videoid");
parse_str($content);
$url = "http://www.youtube.com/get_video.php?video_id=" . $videoid . "&t=" . $token. "&fmt=".$format;
$headers = get_headers($url,1);
if(!is_array($headers['Location'])) {
$url = $headers['Location'];
}else {
foreach($headers['Location'] as $h){
if(strpos($h,"googlevideo.com")!=false){
$url = $h;
break;
}
}
}
if(isset($_GET["debug"])){
print "URI: $url<br/>" ;
echo "<pre>";print_r($headers);
die("it's all folks!");
}
header("Location: $url");
?>

View file

@ -0,0 +1,26 @@
<?php
$videoid=$_GET["v"];
$format = 22;
$content= file_get_contents("http://youtube.com/get_video_info?video_id=$videoid");
parse_str($content);
$url = "http://www.youtube.com/get_video.php?video_id=" . $videoid . "&t=" . $token. "&fmt=".$format;
$headers = get_headers($url,1);
if(!is_array($headers['Location'])) {
$url = $headers['Location'];
}else {
foreach($headers['Location'] as $h){
if(strpos($h,"googlevideo.com")!=false){
$url = $h;
break;
}
}
}
if(isset($_GET["debug"])){
print "URI: $url<br/>" ;
echo "<pre>";print_r($headers);
die("it's all folks!");
}
header("Location: $url");
?>

View file

@ -0,0 +1,26 @@
<?php
$videoid=$_GET["v"];
$format = 35;
$content= file_get_contents("http://youtube.com/get_video_info?video_id=$videoid");
parse_str($content);
$url = "http://www.youtube.com/get_video.php?video_id=" . $videoid . "&t=" . $token. "&fmt=".$format;
$headers = get_headers($url,1);
if(!is_array($headers['Location'])) {
$url = $headers['Location'];
}else {
foreach($headers['Location'] as $h){
if(strpos($h,"googlevideo.com")!=false){
$url = $h;
break;
}
}
}
if(isset($_GET["debug"])){
print "URI: $url<br/>" ;
echo "<pre>";print_r($headers);
die("it's all folks!");
}
header("Location: $url");
?>

View file

@ -0,0 +1,26 @@
<?php
$videoid=$_GET["v"];
$format = 6;
$content= file_get_contents("http://youtube.com/get_video_info?video_id=$videoid");
parse_str($content);
$url = "http://www.youtube.com/get_video.php?video_id=" . $videoid . "&t=" . $token. "&fmt=".$format;
$headers = get_headers($url,1);
if(!is_array($headers['Location'])) {
$url = $headers['Location'];
}else {
foreach($headers['Location'] as $h){
if(strpos($h,"googlevideo.com")!=false){
$url = $h;
break;
}
}
}
if(isset($_GET["debug"])){
print "URI: $url<br/>" ;
echo "<pre>";print_r($headers);
die("it's all folks!");
}
header("Location: $url");
?>