<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>flash播放页</title>
 <script type="text/javascript">
/*
* 智能机浏览器版本信息:
*
*/
 
  var browser={
    versions:function(){
           var u = navigator.userAgent, app = navigator.appVersion;
           return {//移动终端浏览器版本信息
                trident: u.indexOf('Trident') > -1, //IE内核
                presto: u.indexOf('Presto') > -1, //opera内核
                webKit: u.indexOf('AppleWebKit') > -1, //苹果、谷歌内核
                gecko: u.indexOf('Gecko') > -1 && u.indexOf('KHTML') == -1, //火狐内核
                //mobile: !!u.match(/AppleWebKit.*Mobile.*/)||!!u.match(/AppleWebKit/), //是否为移动终端
				 mobile: !!u.match(/AppleWebKit.*Mobile.*/), //是否为移动终端
                ios: !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/), //ios终端
                android: u.indexOf('Android') > -1 || u.indexOf('Linux') > -1, //android终端或者uc浏览器
                iPhone: u.indexOf('iPhone') > -1 || u.indexOf('Mac') > -1, //是否为iPhone或者QQHD浏览器
                iPad: u.indexOf('iPad') > -1, //是否iPad
                webApp: u.indexOf('Safari') == -1 //是否web应该程序，没有头部与底部
            };
         }(),
         language:(navigator.browserLanguage || navigator.language).toLowerCase()
}
function IsPC()
{
 if(browser.versions.mobile|| browser.versions.ios||browser.versions.android||browser.versions.iPhone||browser.versions.iPad)
 {
   return false;
 }
 else
 {
  return true;
  }
}

//document.writeln("语言版本: "+browser.language);
//document.writeln(" 是否为移动终端: "+browser.versions.mobile);
//document.writeln(" ios终端: "+browser.versions.ios);
//document.writeln(" android终端: "+browser.versions.android);
//document.writeln(" 是否为iPhone: "+browser.versions.iPhone);
//document.writeln(" 是否iPad: "+browser.versions.iPad);
//document.writeln(navigator.userAgent);
 
</script>
<script>
        function play() {
            var player = document.getElementById("player");
           // if(player.play) {
           //     player.pause();
           // }else {
                player.play();
           // }
        }

        function mute() {
            var player = document.getElementById("player");
            player.muted = player.muted ? false : true;         
        }
    </script>
 
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<script type="text/javascript">

//获取窗口高度
function getWindowHeight() {
    var windowHeight = 0;
    if (typeof (window.innerHeight) == 'number') {
        windowHeight = window.innerHeight;
    }
    else {
        if (document.documentElement && document.documentElement.clientHeight) {
            windowHeight = document.documentElement.clientHeight;
        }
        else {
            if (document.body && document.body.clientHeight) {
                windowHeight = document.body.clientHeight;
            }
        }
    }
    return windowHeight;
}

//获取窗口宽度
function getWindowWidth() {
    var windowWidth = 0;    
    if (typeof (window.innerWidth) == 'number') {
        windowWidth = window.innerWidth;
    }
    else {
        if (document.documentElement && document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        }
        else {
            if (document.body && document.body.clientWidth) {
                windowWidth = document.body.clientWidth;
            }
        }
    }
    return windowWidth;
}

function GetQueryString(name)
{
	if(name==null){return;}
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}

 var _width=GetQueryString("width");
var _height= GetQueryString("height");
 
if(_width==null || _height==null)

{

_width=getWindowWidth();
_height= getWindowHeight();

 
} 
/**
 * [通过参数名获取url中的参数值]
 * 示例URL:http://htmlJsTest/getrequest.html?uid=admin&rid=1&fid=2&name=小明
 * @param  {[string]} queryName [参数名]
 * @return {[string]}           [参数值]
 */
function GetQueryValue(queryName) {
    var query = decodeURI(window.location.search.substring(1));
    var vars = query.split("&");
    for (var i = 0; i < vars.length; i++) {
        var pair = vars[i].split("=");
        if (pair[0] == queryName) { return pair[1]; }
    }
    return null;
}
var _url=GetQueryValue("url");
//配置的用cdn播放
if(_url.indexOf("http://bj.bcebos.com/v1/mtnetsvideo/")>-1 || _url.indexOf("https://bj.bcebos.com/v1/mtnetsvideo/")>-1)
{
	_url=_url.replace("http://bj.bcebos.com/v1/mtnetsvideo/","http://mtnetsvideo.cdn.bcebos.com/")
	_url=_url.replace("https://bj.bcebos.com/v1/mtnetsvideo/","https://mtnetsvideo.cdn.bcebos.com/")
}
if(_url==null){_url='http://player.youku.com/player.php/Type/Folder/Fid/27296202/Ob/1/sid/XMTU3OTUzNzcyNA==/v.swf'}
//var _flash='<embed src="'+_url+'" width="'+_width+'" height="'+_height+'" quality="high" type="application/x-shockwave-flash" wmode="transparent"></embed>';
var _flash='<video id="player" width="'+_width+'" height="'+_height+'"   controls="controls"> <source src="'+_url+'">您的浏览器不支持 video 标签。</video>';
//ku6播放地址 
if(_url.indexOf("ku6")>-1)
{
 	var substr2 = _url.match(/refer\/(\S*)\/v.swf/); 
	if(substr2.length>0 &&!IsPC())
	{
     	window.location.href='ku6.html?vid='+substr2[1];
		 
	}
	else
	{
		document.writeln(_flash);
		 
	}
}

//qq播放地址 
if(_url.indexOf("qq.com")>-1)
{
	//http://static.video.qq.com/TPout.swf?vid=f0148en4blk  &auto=0
	 ;
	 //alert(GetQueryString("vid"));
	var vid=GetQueryString("vid"); //_url.split("vid=");
	//  alert(vid);
	//var vid=_url.match(/swf(\S*)0/); 
	//if(vid.length>0&&!IsPC())
	//{
 
		//window.location.href='qq.html?vid='+"http://v.qq.com/iframe/player.html?vid="+vid[1]+"&tiny=0&auto=0";
	document.writeln('<iframe id="player" frameborder="no" border="0"marginwidth="0" marginheight="0" scrolling="no"   width="'+_width+'" height="'+_height+'" src="https://v.qq.com/iframe/player.html?vid='+vid+'&tiny=0&auto=0" allowfullscreen></iframe>');
	//}
	//else
	//{
	//	document.writeln(_flash);
	//	 
	//}
}
//ku6播放地址 
//if(_url.indexOf("tudou")>-1)
//{
//	vid=_url;      //_url.match(/vid=(\S*)&/); 
//	if(vid.length>0)
//	{
//	document.writeln('<iframe frameborder="0" width="530" height="350" src="'+vid+'" allowfullscreen></iframe>');
//	}
//	else
//	{
//		document.writeln(_flash);
//		 
//	}
//}
//baidu 
if(_url.indexOf("mda-")>-1 && _url.length<30)
{
	//http://static.video.qq.com/TPout.swf?vid=f0148en4blk  &auto=0
	 ;
	 //alert(GetQueryString("vid"));
	var vid=GetQueryString("vid"); //_url.split("vid=");
	//  alert(vid);
	//var vid=_url.match(/swf(\S*)0/); 
	//if(vid.length>0&&!IsPC())
	//{
 
		//window.location.href='qq.html?vid='+"http://v.qq.com/iframe/player.html?vid="+vid[1]+"&tiny=0&auto=0";
	document.writeln('<iframe  id="player" frameborder="no" border="0"marginwidth="0" marginheight="0" scrolling="no"   width="'+_width+'" height="'+_height+'" src="/baidu/player_mtnets2017.html?url='+_url+'&width='+_width+'&height='+_height+'" allowfullscreen></iframe>');
	//}
	//else
	//{
	//	document.writeln(_flash);
	//	 
	//}
}
if(_url.indexOf("qq")==-1&&_url.indexOf("ku6")==-1 )//&&_url.indexOf("tudou")==-1
{
	document.writeln(_flash); 
}
</script>

</body>
</html>
