播放腾讯视频的js代码 | 胡鹏博客
首页 > js资料 > 播放腾讯视频的js代码
2013二月16

播放腾讯视频的js代码

互联网的盛行 ,各大门户网站都会有意无意的去转载一些别的门户网站上面的信息,那如果转载腾讯网的视频,该如何显示呢?
下面胡鹏就在这里给出一段js方法让大家参考一下。
<div id="shiping"></div>
<script>
function shiPing(temp_u)
	{
	var str= "",vid="",reg = new RegExp("(^|&|\\\\?)vid=([^&]*)(&|$|#)"),r,flashvars="",idx=0;
	//var temp_u="http://v.qq.com/cover/u/ue54pp55jthcmgk.html?vid=9XXmfUU2kLe_0"
	//var temp_u=document.getElementById("jsp_url").value;
	if (r = temp_u.match(reg) ){vid= encodeURIComponent(r[2]);}
	vid =vid || "9XXmfUU2kLe";
	if(vid.indexOf("_")>0){var arr=vid.split("_");idx=parseInt(arr[1]);vid=arr[0];}
	if(!idx && document.location.search.indexOf("oid=")<0){
		flashvars = "vid="+vid+"&autoplay=1&list=2&showcfg=1&tpid=4&title=2012-03-04+%E7%83%AD%E5%88%BA1-3%E6%9B%BC%E8%81%94&adplay=1&cid=ue54pp55jthcmgk";
		str += "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\"600\" height=\"380\" id=\"_playerswf\" align=\"middle\" codebase=\"http:\/\/fpdownload.macromedia.com\/get\/flashplayer\/current\/swflash.cab#version=10,0,0,0\">";
		str += "	<param name=\"allowScriptAccess\" value=\"always\" \/>";
		str += "	<param name=\"movie\" value=\"http://imgcache.qq.com/tencentvideo_v1/player/TencentPlayer.swf?_v=20110829\" \/>";
		str += "	<param name=\"quality\" value=\"high\" \/>";
		str += "	<param name=\"allowFullScreen\" value=\"true\"\/>";
		str += "	<param name=\"play\" value=\"true\" \/>";
		str += "	<param name=\"wmode\" value=\"Opaque\" \/>";
		str += "	<param name=\"flashvars\" value=\""+flashvars+"\"\/>";
		str += "	<param name=\"type\" value=\"application\/x-shockwave-flash\" \/>";
		str += "	<param name=\"pluginspage\" value=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" \/>";
		str += "	<embed wmode=\"Opaque\" ";
		str += "		flashvars=\""+flashvars+"\" ";
		str += "		src=\"http://imgcache.qq.com/tencentvideo_v1/player/TencentPlayer.swf?_v=20110829\" ";
		str += "		quality=\"high\" ";
		str += "		name=\"_playerswf\" ";
		str += "		id=\"_playerswf\" ";
		str += "		bgcolor=\"#000000\" ";
		str += "		width=\"600\" ";
		str += "		height=\"412\" ";
		str += "		align=\"middle\" ";
		str += "		allowScriptAccess=\"always\" ";
		str += "		allowFullScreen=\"true\"  ";
		str += "		type=\"application\/x-shockwave-flash\" ";
		str += "		pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" \/>";
		str += "<\/object> ";
		//document.writeln(str);
		document.getElementById("shiping").innerHTML=str;
	}
}
shiPing("vid=z0011szf839&autoplay=1&list=2&showcfg=1&tpid=4&title=&adplay=1&cid==http://v.qq.com/cover/g");
</script>

这就是调用显示腾讯视频的代码,复制即可使用。
更多

文章作者:东莞seo
本文链接地址:http://www.seostudying.com/1025.html
欢迎转载,转载请注明出处»胡鹏博客 [播放腾讯视频的js代码]

本文目前尚无任何评论.
您必须在 登录 后才能发布评论.