﻿//showPlayer('url1,title1,url2,title2');
function showPlayer(flv){
	var flvs=flv.split(',');
	if(flvs.length%2!=0){
		document.write("参数错误");
		return;
	}
	document.write('		<object id="vcastr3" type="application/x-shockwave-flash" data="/plus/player/vcastr3.swf" width="702" height="540" id="vcastr3">');
	document.write('			<param name="movie" value="/plus/player/vcastr3.swf"/>');
	document.write('			<param name="allowFullScreen" value="true" />');
	document.write('			<param name="FlashVars" value="xml=');
	document.write('				<vcastr>');
	document.write('					<channel>');
	for(var i=0;i<flvs.length;i=i+2){
		document.write('						<item>');
		document.write('							<source>'+flvs[i]+'</source>');
		document.write('							<duration></duration>');
		document.write('							<title>'+flvs[i+1]+'</title>');
		document.write('						</item>');
	}
	document.write('					</channel>');
	document.write('					<config>');
	document.write('						<buffertime>2</buffertime>');
	document.write('						<contralPanelAlpha>0</contralPanelAlpha>');
	document.write('						<controlPanelBgColor>0x000000</controlPanelBgColor>');
	document.write('						<controlPanelBtnColor>0xffffff</controlPanelBtnColor>');
	document.write('						<contralPanelBtnGlowColro>0xffff00</contralPanelBtnGlowColro>');
	document.write('						<controlPanelMode>float</controlPanelMode>');
	document.write('						<defautVolume>0.5</defautVolume>');
	document.write('						<isAutoPlay>false</isAutoPlay>');
	document.write('						<isLoadBegin>false</isLoadBegin>');
	document.write('						<isShowAbout>false</isShowAbout>');
	document.write('						<scaleMode>showAll</scaleMode>');
	document.write('					</config>');
	document.write('					<plugIns>');
	document.write('						<logoPlugIn>');
	document.write('							<url>/plus/player/logoPlugIn.swf</url>');
	document.write('							<logoText>Tengfei Studio</logoText>');
	document.write('							<logoTextAlpha>0.75</logoTextAlpha>');
	document.write('							<logoTextFontSize>30</logoTextFontSize>');
	document.write('							<logoTextLink>http://www.52xjtu.com</logoTextLink>');
	document.write('							<logoTextColor>0xffffff</logoTextColor>');
	document.write('							<textMargin>20 20 auto auto</textMargin>');
	document.write('						</logoPlugIn>');
	document.write('					</plugIns>');
	document.write('				</vcastr>"/>');
	document.write('		</object>');
	}

//showFlash('url1,title1,url2,title2');
function showFlash(flash){
	var flashs=flash.split(',');
	if(flashs.length%2!=0){
		document.write("参数错误");
		return;
	}
	var params={play:'false'};
	if(flashs.length==2)params={play:'true'};
	for(var i=0;i<flashs.length;i=i+2){
		if(i>0)document.write('		<hr>');
		document.write('		<p>'+flashs[i+1]+'</p>');
		document.write('		<div id="flashContainer_'+i+'"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://host.52xjtu.com/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div>');
		swfobject.embedSWF(flashs[i],'flashContainer_'+i,"700","560","9.0.0","http://host.52xjtu.com/expressInstall.swf",{},params,{});
	}
}

function showRealPlayer(url){
document.write('<table width="702" border="0" cellpadding="0" cellspacing="0">');
document.write('  <tr>');
document.write('    <td>');
document.write('        <object id="player" classid="clsid:cfcdaa03-8be4-11cf-b84b-0020afbbccfa" width=702 height=540 style="z-index:1" border="0">');
document.write('            <param name="src" value="'+url+'">');
document.write('            <param name="loop" value="false">');
document.write('            <param name="autostart" value="false">');
document.write('            <param name="console" value="one">');
document.write('            <param name="controls" value="imagewindow">');
document.write('            <param name="backgroundcolor" value="black">');
document.write('            <param name="center" value="true">');
document.write('        </object>');
document.write('    </td>');
document.write('  </tr>');
document.write('  <tr>');
document.write('    <td>');
document.write('		<div id="tengfeiPlayer"><a href="http://www.adobe.com/go/getflashplayer"><img src="http://host.52xjtu.com/get_flash_player.gif" alt="Get Adobe Flash player" /></a></div>');
document.write('    </td>');
document.write('  </tr>');
document.write('</table>');
var params={
_cx:"18573",
_cy:"1587",
WMode:"Window",
Play:"0",
Loop:"-1",
Quality:"High",
Menu:"-1",
AllowScriptAccess:"sameDomain",
Scale:"ShowAll",
BGColor:"000000",
AllowFullScreen:"false"};
swfobject.embedSWF('/plus/player/tengfeiPlayer.swf?v=1.0','tengfeiPlayer',"702","60","9.0.0","http://host.52xjtu.com/expressInstall.swf",{},params,{});
}
	/*RealPlayer control function*/
function Play(){if (player.GetPlayState() != 3){player.DoPlay();SliderOn(true);return true;}return false;}
function Pause(){if (player.GetPlayState() == 3){player.DoPause();SliderOn(false);return true;}return false;}
function Stop() {player.DoStop();}
function FullScreen() {	player.SetFullScreen();}
function SetVolume(pos) {player.SetVolume(pos);}//percentage,ex,0.4
function SetPosition(pos) {var length=player.GetLength();if(pos>1.0)pos=1;player.SetPosition(pos* length);}
var updateID=null;
function SliderOn(on){if(on&&updateID==null)updateID=setInterval(updatePosition,1000);else if(!on&&updateID!=null)window.clearInterval(updateID);}
function updatePosition(){tengfeiPlayer.SetPosition(player.GetPosition());}








