Live cricket


This player will be replaced

// Omniture variables to help populate player
var currentBuffer = 0;
var currentPosition = 0;
var currentState = “NONE”;
var defaultState = “NONE”;
var currentLoad = 0;
var clipDuration = 0;
var videoFileName = “ICC Live Stream – 0930″;
//————–

var flashvars = {
duration: ‘0’,
start: ‘0’,
interrupt: ‘false’,
align: ‘bottom’,
bufferlength: ‘0.8’,
shownavigation: ‘false’,
showdigits: ‘false’,
autostart: ‘true’,
repeat: ‘true’,
dock: ‘true’,
file: ‘Cricket_Feb_2011@s46005?auth=daEbwaGc5cwcibsa1b_dOdVarazdqa9aobc-bnClCH-c0-NAtnApEQvlj9db%26aifp=v1’,
streamer: ‘rtmp://cp116713.live.edgefcs.net/live/’,
‘rtmp.subscribe’: ‘true’,
plugins: ‘dcinstream’,
‘dcinstream.admessagedynamic’:’This ad will close in 5 seconds’,
‘dcinstream.admessagedynamickey’:’5′,
‘dcinstream.admessagestatic’:”,
‘dcinstream.ad.flash_in_flash.position’:’0:10′,
‘dcinstream.ad.flash_in_flash.interrupt’: ‘false’,
‘dcinstream.ad.flash_in_flash.position’: ‘bottom’,
‘dcinstream.ad.tag’: ‘http://ad.doubleclick.net/pfadx/cricket.cwc.espnstar.com/live1;fmt=flv;sz=320×240;ord=5568443235?’,
‘dcinstream.ad.position’: ‘pre’,
image: ‘images/icclive_firstscreen_new2.jpg’

};
swfobject.embedSWF(‘http://www.espnstar.com/essvideos/icclive/JWPlayer/player.swf’, ‘container’, ‘440’, ‘355’, ‘9.0.115’, ‘false’, flashvars,
{ allowfullscreen: ‘true’, allowscriptaccess: ‘always’, wmode: ‘transparent’ },
{ id: ‘jwplayer’, name: ‘jwplayer’ }, flashLoaded
);

//playerReady(‘container’);
var playerRef;
function playerReady(obj) {
playerRef = document.getElementById(obj[‘id’]);
addListeners();
};
// Omniture here
function addListeners() {
//load the JWplayer event listners
if (playerRef) {
addAllModelListeners();
}
}

function addAllModelListeners() {
if (typeof playerRef.addModelListener == “function”) {
playerRef.addModelListener(“BUFFER”, “doNothing”); //{percentage,id,client,version}.
playerRef.addModelListener(“ERROR”, “myError”); //{message,id,client,version}.
playerRef.addModelListener(“LOADED”, “doNothing”); //{loaded,total,offset,id,client,version}.
playerRef.addModelListener(“META”, “doNothing”); //{variable1,variable2,variable3,…,id,client,version}.
playerRef.addModelListener(“STATE”, “stateListener”);//{newstate,oldstate,id,client,version}.
playerRef.addModelListener(“TIME”, “positionListener”); //{position,duration,id,client,version}.
}
}
function doNothing(obj) { //nothing
}

function positionListener(obj) {
//let’s us know where we are in the video
currentPosition = obj.position ;
clipDuration = obj.duration ;
}

function stateListener(obj) {
oldState = obj.oldstate;
if (defaultState == “NONE”) {
defaultState = “started”;
getTimeValue();
}
currentState = obj.newstate;
//currentTime = obj.position;

//pass the event to Omniture
if (currentState == “COMPLETED”){
omniMediaTrackingDone(videoFileName,currentPosition);
}
if (currentState == “PLAYING”){
if (currentPosition != “0”){
omniMediaTrackingResume(videoFileName,currentPosition);
}
}
if (currentState == “PAUSED”){
omniMediaTrackingStop(videoFileName,currentPosition);
}
}

// according to Rudi you can not combine the listener events, so the functions below are a workaround to get the length/pos of the video file
function getTimeValue(){
if (currentPosition == “0”){
//needed to allow the video to load in in order to capture the parameters
setTimeout(“getTimeValue()”,100);
}else{
omniInitMediaTracking(videoFileName,clipDuration,’JWplayer’);
}
}
//Omniture ends here

function myError(obj) {
//let’s us know where we are in the video
//currentPosition = obj.position ;
//clipDuration = obj.duration ;
//obj.image =”/images/btn-icclive2.gif”;
//document.getElementById[jwplayer].style.display = ‘none’;

var a= obj;
b = a.message.toString();
// alert(“Error “+b);

if(b.indexOf(‘not found’) !=-1)
{
jwplayer.style.display = ‘none’;
notfound.style.display = ‘block’;

}

if(b.indexOf(‘Subscription’) !=-1)
{
jwplayer.style.display = ‘none’;
schedule.style.display = ‘block’;

}

if(b.indexOf(‘Access’) !=-1)
{
jwplayer.style.display = ‘none’;
region.style.display = ‘block’;

}
}

function flashLoaded(e) {
// e.ref is a reference to the Flash object. We’ll pass it to jwplayer() so the API knows where the player is.

//var p = document.getElementById(‘jwplayer’);
//alert(p+”+e.ref);
//p.onReady(function() { alert(“Player is ready”); });
// Add event listeners
//jwplayer(e.ref).onReady(function() { alert(“Player is ready”); });
//jwplayer(e.ref).onPlay(function() { alert(“Player is playing”); });

// Interact with the player
//jwplayer(e.ref).play();
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: