﻿<!--
/*
ten sam odtwarzacz co odtwarzacz.js (np. na film.wp.pl), z usunietym oskorkowaniem
dla wina&ie oraz okrojonym paskiem przyciskow
*/

var isWin = false;
var isIE = false;
var isWMP_GET6 = false;
var isWMP_GET7 = false;
var netAPI = false;
//

function getFlashString(swfUrl, id, width, height, wMode, bgColor, flashVars)
{

	var f =	''	+
			'<object id="'+id+'" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+width+'" height="'+height+'"> \n'+
			' <param name="allowScriptAccess" value="always" /> \n'+
			' <param name="movie" value="'+swfUrl+'" /> \n'+
			' <param name="flashvars" value="'+flashVars+'" /> \n'+
			' <param name="menu" value="false" /> \n'+
			' <param name="quality" value="high" /> \n'+
			' <param name="wmode" value="'+wMode+'" /> \n'+
			' <param name="bgcolor" value="'+bgColor+'" /> \n'+
			' <embed src="'+swfUrl+'" flashvars="'+flashVars+'" quality="high" bgcolor="'+bgColor+'" width="'+width+'" height="'+height+'" name="'+id+'" align="middle" menu="false" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> \n'+
			'</object> \n';
	
	return f;
		
}


var WMP6_Obj = '';
	WMP6_Obj += '<object id=MPlayer ';
	WMP6_Obj += 'classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 ';
	WMP6_Obj += 'codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 ';
	WMP6_Obj += 'standby="Loading Microsoft Windows Media Player components..." ';
	WMP6_Obj += 'type="application/x-oleobject" width="'+wmWidth+'" height="'+wmHeight+'">';
	WMP6_Obj += ' <param name="FileName" value="'+wmpSrc+'" />';
	WMP6_Obj += ' <param name="enableContextMenu" value="false" />';
	WMP6_Obj += ' <param name="DisplaySize" value="0" />';
	WMP6_Obj += ' <param name="ShowStatusBar" value="1" />';
	if(autostart == true){
		WMP6_Obj += ' <param name="AutoStart" value="true" />';
	} else {
		WMP6_Obj += ' <param name="AutoStart" value="false" />';
	}
	WMP6_Obj += ' <param name="ShowControls" value="1" />';
	WMP6_Obj += ' <param name="autoRewind" value="true" /> ';
	WMP6_Obj += '</object>';

//
var WMP7_Obj = '';
	WMP7_Obj += '<object id=MPlayer ';
	WMP7_Obj += ' classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6';
	WMP7_Obj += ' standby="Loading Microsoft Windows Media Player components..."';
	WMP7_Obj += ' type="application/x-oleobject" width="'+wmWidth+'" height="'+wmHeight+'">';
	WMP7_Obj += '  <param name="url" value="'+wmpSrc+'" />';
	WMP7_Obj += '  <param name="enableContextMenu" value="false" />';
	WMP6_Obj += ' <param name="ShowStatusBar" value="1" />';
	if(autostart == true){
		WMP7_Obj += '  <param name="AutoStart" value="true" />';
	} else {
		WMP7_Obj += '  <param name="AutoStart" value="false" />';
	}
	WMP7_Obj += '  <param name="ShowControls" value="1" />';
	WMP7_Obj += '  <param name="uiMode" value="mini" />';
	WMP7_Obj += '  <param name="autoRewind" value="true" /> ';
	WMP7_Obj += ' <param name="DisplaySize" value="0" />';
	WMP7_Obj += '</object>';
//	
var WMP_Emb = '';
	WMP_Emb += '<object classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,5,715 type="application/x-oleobject" id="MPlayer" height="'+wmHeight+'" width="'+wmWidth+'">';
	if(autostart == true){
		WMP_Emb += '  <param name="AutoStart" value="true" />';
	} else {
		WMP_Emb += '  <param name="AutoStart" value="false" />';
	}
	WMP_Emb += ' <param name="DisplaySize" value="0">';
	WMP_Emb += ' <param name="EnableContextMenu" value="0">';
	WMP_Emb += ' <param name="EnablePositionControls" value="0">';
	WMP_Emb += ' <param name="EnableFullScreenControls" value="0">';
	WMP_Emb += ' <param name="EnableTracker" value="1">';
	WMP_Emb += ' <param name="Filename" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="URL" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="src" value="'+wmpSrc+'"';
	WMP_Emb += ' <param name="Rate" value="1">';
	WMP_Emb += ' <param name="ShowCaptioning" value="0">';
	WMP_Emb += ' <param name="ShowControls" value="1">';
	WMP_Emb += ' <param name="ShowAudioControls" value="1">';
	WMP_Emb += ' <param name="ShowDisplay" value="0">';
	WMP_Emb += ' <param name="ShowGotoBar" value="0">';
	WMP_Emb += ' <param name="ShowPositionControls" value="1">';
	WMP_Emb += ' <param name="ShowStatusBar" value="1">';
	WMP_Emb += ' <param name="ShowTracker" value="1">';
	WMP_Emb += ' <param name="Volume" value="50">';
	WMP_Emb += ' <embed type="application/x-mplayer2"';
	WMP_Emb += ' pluginspage="http://www.microsoft.com/windows/windowsmedia/"';
	WMP_Emb += ' filename="'+wmpSrc+'"';
	WMP_Emb += ' src="'+wmpSrc+'"';
	WMP_Emb += ' name=MPlayer';
	WMP_Emb += ' enableContextMenu=0';
	WMP_Emb += ' showcontrols=1';
	WMP_Emb += ' autorewind=1';
	if(autostart == true){
		WMP_Emb += ' autostart=1';
	} else {
		WMP_Emb += ' autostart=0';
	}
	WMP_Emb += ' displaysize=0';
	WMP_Emb += ' showstatusbar=1';
	WMP_Emb += ' width='+wmWidth+'';
	WMP_Emb += ' height='+wmHeight+'>';
	WMP_Emb += '</embed>';
	WMP_Emb += '</object>';
//
function videoPlayerMode(n) {
	if (n == 1) {
		document.getElementById('vpFilm').style.height=advPlayerHeight + 'px';
		document.getElementById('vpFilm').style.overflow='visible';
		document.getElementById('vpWM').style.display='';
	} else if (n == 0) {
		document.getElementById('vpFilm').style.height=advPlayerHeight + 'px';
		document.getElementById('vpFilm').style.overflow='visible';
		document.getElementById('vpWM').style.display='';
	}
}
// Detekcja

var uAgt = navigator.userAgent.toLowerCase();
isIE = (uAgt.indexOf("msie") != -1) && (uAgt.indexOf("opera") == -1 && (navigator.appName.indexOf("Microsoft Internet Explorer") != -1));
isWin = navigator.platform.indexOf("Win") != -1;

	var pWMP = (navigator.mimeTypes && navigator.mimeTypes["application/x-mplayer2"]) ? navigator.mimeTypes["application/x-mplayer2"].enabledPlugin : 0;
	if (pWMP) {
		isWMP_GET6 = true;
	}
//
function addWmvPlayer() {
	if(isWin && isIE){
		if(isWMP_GET7){
			//
			videoPlayerMode(0);
			document.getElementById('vpFilm').innerHTML = WMP7_Obj;
		} else {
			//
			document.getElementById('vpFilm').innerHTML = WMP6_Obj;
		}
	} else if(isWMP_GET6) {
		//
		setTimeout("document.getElementById('vpFilm').innerHTML = WMP_Emb;", 500);
		//
		videoPlayerMode(0);
	} else {
		//Tylko link do pliku
		document.getElementById('vpFilm').innerHTML = getVideoFileTxt;
		//
		videoPlayerMode(0);
	}
}

/**
* Reklama FLV
*/
function onAdvPlayerLoaded(bytesTotal)
{
}

function onAdvPlayerFinished(streamTime)
{
	
	addWmvPlayer();

}


/**
* init
* description: onload called method
*/
function init()
{
	// Czy jest Flash [getFlashVersion() - funkcja systemu reklamowego]
	isFLP = ( 8 >= 8 ) ? true : false;
	
	// Uaktywnienie komunikacji WMP <-> FLASH
	//initNetAPI();
	
	if(isFLP && isAdv && advPlayerMovieUrl!='')
	{
		
		var fVars = "aWidth="+advPlayerWidth+
					"&amp;aHeight="+advPlayerHeight+
					"&amp;aMovieUrl="+advPlayerMovieUrl+
					"&amp;aAutoStart="+advPlayerAutoStart+
					"&amp;aVolume="+advPlayerVolume+
					"&amp;aBgColor="+advPlayerBgColor+
					"&amp;aBgAlpha="+advPlayerBgAlpha+
					"&amp;aClickUrl="+advPlayerClickUrl+
					"&amp;aWindowType="+advPlayerWindowType+
					"&amp;aScaleMode="+advPlayerScaleMode+
					"&amp;aBuffBgColor="+advPlayerBuffBgColor+
					"&amp;aBuffBgAlpha="+advPlayerBuffBgAlpha+
					"&amp;aBuffFontColor="+advPlayerBuffFontColor+
					"&amp;aBuffAlign="+advPlayerBuffAlign;

		document.getElementById('vpFilm').innerHTML = getFlashString( "advFlvPlayer.swf", "advPlayer", advPlayerWidth, advPlayerHeight, "transparent", "#000000", fVars)
		videoPlayerMode(1);
		
	} else {
		
		addWmvPlayer();
		
	}

}

if(window.onload==null){window.onload=init;} else {var REF_F=window.onload;window.onload=function() {if(window.REF_F) REF_F();init();};};

-->

