62,046
社区成员
发帖
与我相关
我的任务
分享
<script language="javascript" type="text/javascript" id="javascript_id">
var nowfile = "";
var vvv = window.parent.parent.document.getElementById("isReview").value;
if(vvv == "false")
{
nowfile = window.parent.parent.document.getElementById("Advertfile").value;
}
else
{
nowfile = window.parent.parent.document.getElementById("ReAdvertfile").value;
}
//15秒动态控制时间
var timer = null;
var cnt = 14;
function setTime()
{
if(cnt>=0)
{
if(document.getElementById("txtTip")!=null)
{
document.getElementById("txtTip").innerText=cnt+'秒内未确定视为自动放弃本次抽奖机会';
cnt--;
}
}else
{
window.clearInterval(timer);
window.parent.parent.firstView(0);
window.parent.parent.GB_hide();
}
}
// some variables to save
var currentPosition;//当前播放秒数
var currentVolume;//当前音量
var currentItem;//当前播放项
// these functions are caught by the JavascriptView object of the player.
function sendEvent(typ,prm)
{
alert(thisMovie("player_id"));
thisMovie("player_id").sendEvent(typ,prm);
};
//case "playpause": 暂停
//"prev": "next":"stop": 上一项 下一项 停止
//scrub":秒数"volume":音量 playitem 播放项"getlink": "fullscreen": "complete": "captions":标题 "audio":
function getUpdate(typ,pr1,pr2,pid) {
if(typ == "time")
{
currentPosition = pr1;
if(pr1 != 0 && pr2 ==0)
{
var v = window.parent.parent.document.getElementById("isReview").value;
if(v == "false")
{
document.getElementById("divContant").innerHTML =
'<table style="background-color:Black;height:300px;width:400px;"><tr><td align="center" valign="middle"><input id="btn" type="button" style="background-image: url(../../image/adico3.gif); background-color: transparent;width:278px;height:40px;border-style:none; cursor:pointer;" value="" onclick="stopPlay(1);" /> <input id="txtTip" type="text" value="15秒内未确定视为自动放弃本次抽奖机会" readonly="readonly" style="width: 278px;height:38px;background-image: url(../../image/adico4.gif); border-style:none; text-align:center; font-weight: bold; vertical-align: bottom; color: white;"/> </td></tr></table>';
timer = window.setInterval('setTime();', 1000);
}
else
{
document.getElementById("divContant").innerHTML =
'<table style="background-color:Black;width:400px;height:300px"><tr><td align="center" valign="middle"><input id="ok" type="button" style="background-image: url(../../image/adico3.gif); background-color: transparent;width:278px;height:40px;border-style:none; cursor:pointer;" value="" onclick="stopPlay(0);" /></td></tr></table>';
}
}
}
else if(typ == "volume") { currentVolume = pr1; }
else if(typ == "item") { currentItem = pr1; setTimeout("getItemData(currentItem)",100); }
var id = document.getElementById(typ);
id.innerHTML = typ+ ": "+Math.round(pr1);
pr2 == "undefined" ? null: id.innerHTML += ", "+Math.round(pr2);
if(pid != "null") {
document.getElementById("pid").innerHTML = "(来自播放器 <i>"+pid+"</i>的消息)";
}
};
// These functions are caught by the feeder object of the player. RSS专用
function loadFile(obj) { thisMovie("mpl").loadFile(obj); };
function addItem(obj,idx) { thisMovie("mpl").addItem(obj,idx); }
function removeItem(idx) { thisMovie("mpl").removeItem(idx); }
function getItemData(idx) {
var obj = thisMovie("player_id").itemData(idx);
var nodes = "";
for(var i in obj) {
nodes += "<li>"+i+": "+obj[i]+"</li>";
}
document.getElementById("data").innerHTML = nodes;
};
// This is a javascript handler for the player and is always needed.
function thisMovie(movieName) {
if(navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
};
function stopPlay(i)
{
if(i == "1")
{
window.parent.parent.firstView(1);
}
window.parent.parent.GB_hide();
}
</script>
/// <summary>
/// 生成播放Flv格式文件的HTML代码
/// </summary>
/// <param name="url">Flv格式文件的URL</param>
/// <param name="width">播放控件的显示宽度</param>
/// <param name="height">播放控件的显示高度</param>
/// <returns></returns>
public static string MakeFlvHtml(string url, int width, int height)
{
StringBuilder buffer = new StringBuilder(1024);
if (!string.IsNullOrEmpty(url))
{
buffer.Append("<object type=\"application/x-shockwave-flash\" data=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>" + url + "</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\"\n");
buffer.Append("width=" + width + " height=" + height + " id=\"vcastr3\">\n");
buffer.Append("<param name=\"wmode\" value=\"transparent\">\n");
buffer.Append("<param name=\"movie\" value=\"/images/vcastr3.swf?xml=<vcastr>\n");
buffer.Append("<channel>\n");
buffer.Append("<item>\n");
buffer.Append("<source>" + url + "</source>\n");
buffer.Append("<duration></duration>\n");
buffer.Append("<title></title>\n");
buffer.Append("</item>\n");
buffer.Append("</channel>\n");
buffer.Append("</vcastr>\" />\n");
buffer.Append("<param name=\"allowFullScreen\" value=\"true\" />\n");
buffer.Append("</object>\n");
}
else
{
buffer.Append("暂无视频!");
}
return buffer.ToString();
}