﻿
var appVideo=new Object();
appVideo._data=new Array();
appVideo._player=new Array();

appVideo.getData=function(strKey) { return this._data[strKey]; }
appVideo.setData=function(strKey,strValue) { this._data[strKey]=strValue; }


appVideo.doFixPlay=function(strID,strFixID)
{
	var tmpDIV=$("div-view-player");
	if (isObject(tmpDIV))
	{
		var tmpDisplay=tmpDIV.style.display;
		if (tmpDisplay=="none") tmpDIV.style.display=(tmpDisplay=="") ? "none" : "";
		var tmpType=this._data['type'];
		if (isEmpty(tmpType)) tmpType='wmp';
		this._player=new libVDCSPlay();
		this._player.setID("video_play_fix");
		this._player.setType(tmpType);
		this._player.setName($("name-"+strFixID).innerHTML);
		this._player.setURL("url.asp?action=play&id="+strID+"&fixid="+strFixID);
		this._player.setSize(360,340);
		this._player.doParse();
		try
		{
			tmpDIV.style.display="";
			tmpDIV.innerHTML=this._player.getHTML();
			window.setTimeout("appVideo.doFixPlayInfo()",1000);
		}
		catch(e) { dbg.e(e); }
	}
	return false;
}

appVideo.doFixPlayInfo=function()
{
	return;
	var tmpTimes=this._player.getTimes();
	var tmpObject=$("div-view-play-times");
	if (tmpTimes>0 && tmpObject)
	{
		tmpObject.style.display="";
		var tmpAry=this._player.getTimeAry();
		if ($("fix-play-hour")) $("fix-play-hour").innerHTML=tmpAry[1];
		if ($("fix-play-minute")) $("fix-play-minute").innerHTML=tmpAry[2];
		if ($("fix-play-second")) $("fix-play-second").innerHTML=tmpAry[3];
		//alert(tmpAry[1]+":"+tmpAry[2]+":"+tmpAry[3]+"."+tmpAry[4]);
	}
}

appVideo.doFixDownload=function(strID,strFixID)
{
	var tmpURL="url.asp?action=download&id="+strID+"&fixid="+strFixID;
	var tmpDIV=$("div-view-downloader");
	if (isObject(tmpDIV))
	{
		var tmpValue="<a href=\""+tmpURL+"\">点击下载此影片</a>";
		try
		{
			tmpDIV.style.display="";
			tmpDIV.innerHTML=tmpValue;
		}
		catch(e) { dbg.e(e); }
	}
	var tmpObjectURL=$("fix-download-url");
	if (isObject(tmpObjectURL))
	{
		try
		{
			tmpObjectURL.innerHTML=tmpURL;
		}
		catch(e) { dbg.e(e); }
	}
	return false;
}
