Signin  Pricing  Examples  Support

Libraries > video.js

video.js - Search Live Website Code
It's like doing CTRL+F on millions of websites' source code



NerdyData is a search engine for source code. Search the source code of 200 million websites.


JAVASCRIPT FILE http://www.antena3.com/static/swfexportable/video.js

Function Explorer










Libraries on www.antena3.com


jquery.bxslider.js

swfobject.js

video.js



Explore More


AC_RunActiveContent.js

jquery.jcarousel.pack.js

jquery.blockUI.js

jquery.cookie.js

video.js
				
var mainDomain = "http://www.antena3.com";
var converter = "http://iosphp.antena3.com/ios/getatresclip.php";

function createVideo(videoPk, videoDataUrl, divTarget, width, height){
	var data={};
	data.episodePk=videoPk;
	data.embedName=divTarget;
	data.tags="Video";
	data.videDataPath=videoDataUrl;
	data.videoDataUrl=mainDomain+videoDataUrl;
	data.adsUrl=mainDomain+"/static/swfexportable/ads.xml";
	data.playerWidth=width;
	data.playerHeight=height;
	data.buttons="volume";
	
	if (isMobile()) {
		createHtml5Player(data);
	} else {
		createFlashPlayer(data);
	}
} 

function createFlashPlayer(data){
	if (window.navigator.appVersion.toLowerCase().indexOf('linux') != -1 || swfobject.hasFlashPlayerVersion("11.2.000.000")) {
		$('#'+data.embedName).append('<div id="content_videoplayer_'+data.embedName+'"/>');
		
		$('#imgCarton').remove();
		
		var swfVersionStr = "11.2.000.000";
		var xiSwfUrlStr = "";
		
		var flashvars = {};
		flashvars.sessionId="free";
		flashvars.uid=data.uId;
		flashvars.contentPk=data.episodePk;
		flashvars.pagePk=data.pagePk;
		flashvars.section=data.sections;
		flashvars.tags=data.tags;
		flashvars.videoDataUrl=data.videoDataUrl;
		flashvars.propertiesUrl=mainDomain+"/static/swfexportable/propertiesA3.xml";
		flashvars.adsUrl=mainDomain+"/static/swfexportable/ads.xml";
		flashvars.sitesUrl=mainDomain+"/static/swfexportable/sites.xml";
		flashvars.controlButtons="volume,fullScr";
		flashvars.actionButtons=data.actions;
		flashvars.autoPlay="false";
		flashvars.languageInit="es";
		flashvars.timeInit=0;
		flashvars.sas_target=typeof keywords !== "undefined" && keywords != null?keywords:"";
		
		var params = {};
		params.menu = "false";
		params.allowfullscreen = "true";
		params.allowscriptaccess = "always";
		params.wmode = "direct";
		params.quality = "high";
		params.bgcolor = "#000000";
		
		var attributes = {};
		attributes.id = "live";
		attributes.name = "live";
		attributes.align = "middle";
		
		var embedName = "content_videoplayer_"+data.embedName;
		
		var widthPlayer="640";
		if (data.playerWidth!=null){
			widthPlayer=data.playerWidth;
		}
		var heigthPlayer="345";
		if (data.playerHeight!=null){
			heigthPlayer=data.playerHeight;
		}
		swfobject.embedSWF(mainDomain+"/static/swfexportable/player.swf?nc=200", embedName, widthPlayer, heigthPlayer, swfVersionStr, xiSwfUrlStr, flashvars, params, attributes);
	}else {
		var carton=	'<div class="carton">'+
					'<img src="'+mainDomain+'/static/swf/img/cartonFlashVersion.jpg" />'+
					'<a href="http://www.adobe.com/go/getflashplayer" target="_blank" class="btn">'+
						'<img src="'+mainDomain+'/static/swf/img/160x41_Get_Flash_Player.jpg" />'+
					'</a>'+
					'</div>';
		$('#capa_modulo_videoplayer_'+data.embedName).append(carton);
	}
}


function isMobile(){
	return (navigator.userAgent.toLowerCase().search(/iphone|ipod|ipad|android/) > -1);
}


function createHtml5Player(data) {
	var layer = document.getElementById(data.embedName);
	if (data.embedName == 'playerGral') {
		layer.innerHTML = "<div id=\"iosLoader_"+data.embedName+"\" style=\"display:none; position:absolute; left: 44.5%; top: 40%; z-index: 2000\"><img src=\"http://www.antena3.com/static/images/iosloader.gif\"/></div >";
	} else {
		layer.style.width=data.playerWidth+"px";
		layer.style.height=data.playerHeight+"px";
		layer.innerHTML = "<div id=\"iosLoader_"+data.embedName+"\" style=\"display: none; position:relative; left: 44.5%; top: 40%; z-index: 2000\"><img src=\"http://www.antena3.com/static/images/iosloader.gif\"/></div></div >";
	}
	var htmlbtns = '<span>Partes: </span>';
	var selected = "_selected";
	createQuickTimePlayer(eval(data));
}

function createQuickTimePlayer(data) {
 $('#iosLoader_'+data.embedName).show();
 $('#iosPlayer_'+data.embedName).hide();
 $('.play_video').hide();
 var xhr = new XMLHttpRequest();
 url = converter + '?xml=' + data.videDataPath + "&part=0";
 
 if (xhr && "withCredentials" in xhr){
      xhr.open('GET', url, true);
 }

 xhr.onload = function() {
   doClick(this, data);
 };
 xhr.send();
}

function doClick(object, data) {
 var layer = document.getElementById(data.embedName);
 var xmlr = object.responseText;
 if (object.status == 200) {
   var xml = xmlr.split("::");
   
   if (xml.indexOf("bad content") != -1) {
     alert("Este video no se encuentra disponible en este momento, disculpe las molestias\n(error code: 0x0f)");
     $('#iosLoader_'+data.embedName).hide();
     $('#iosPlayer_'+data.embedName).show();
     $('.play_video').show();
   } else if (xml[0].indexOf("content") == -1) {
     var href=xml[0];
     setTimeout(function() {
       function timedOpen(xml) {
         $('#iosLoader_'+data.embedName).hide();
         $('#iosPlayer_'+data.embedName).show();
         $('.play_video').show();
         setTimeout(function() {
           function relocate(href) {
             //window.location.href = href
             $('#'+data.embedName).html(
                '<video id="video_'+data.embedName+'" width="100%" height="100%" controls poster="">' +
           '<source src="'+href+'" type="application/x-mpegURL"></source>' +
         '</video>');
           };
           relocate(xml[0])
         }, 300);
       };
       timedOpen(xml);
     }, 12000);
   } else {
     $('#iosLoader_'+data.embedName).hide();
     $('#iosPlayer_'+data.embedName).show();
     $('.play_video').show();
     setTimeout(function() {
       function relocate(href) {
         //window.location.href = href
         $('#'+data.embedName).html(
                '<video id="video_'+data.embedName+'" width="100%" height="100%" controls poster="">' +
           '<source src="'+href+'" type="application/x-mpegURL"></source>' +
         '</video>');
       };
       relocate(xml[0])
     }, 300);
   }
 } else {
   alert("Este video no se encuentra disponible en este momento, disculpe las molestias\n(error code: " + object.status + ")");
 }
}


A B C D E F G H I J K L M N O P Q R S T U V W X Y Z