<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">
//获取窗口宽度
function getWindowWidth() {
    var windowWidth = 0;
    if (typeof (window.innerWidth) == 'number') {
        windowWidth = window.innerWidth;
    }
    else {
        if (document.documentElement &amp;&amp; document.documentElement.clientWidth) {
            windowWidth = document.documentElement.clientWidth;
        }
        else {
            if (document.body &amp;&amp; document.body.clientWidth) {
                windowWidth = document.body.clientWidth;
            }
        }
    }
    return windowWidth;
}

if(phone()||isWeiXin()){

var VideoIframeObj = document.getElementsByName("myvideo");
if (VideoIframeObj.length &gt; 0) {
    for (var i = 0; i &lt; VideoIframeObj.length; i++) {
        var _ddWidth = parseInt(getWindowWidth() * 90 / 100);
        var _dheight = 180;
        if (_ddWidth &gt; 0) {
            _dheight = parseInt(9 * _ddWidth/16)
        }

        VideoIframeObj[i].style = "width:" + _ddWidth + "px;height:" + _dheight + "px;";
        VideoIframeObj[i].height = _dheight;
        VideoIframeObj[i].width = _ddWidth;
        var videosrc = VideoIframeObj[i].src;
        var reger = new RegExp("&amp;width=\\d+", "gmi");
        videosrc = videosrc.replace(reger, "&amp;width=" + _ddWidth);
        reger = new RegExp("&amp;height=\\d+", "gmi");
        videosrc = videosrc.replace(reger, "&amp;height=" + _dheight);
        VideoIframeObj[i].src = videosrc;

    }
}
}
function phone(){
if((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
  // console.log('移动端');
  return true;
} else {
  // console.log('pc端');
 return false;
}


    }


function isWeiXin(){
  var ua = window.navigator.userAgent.toLowerCase();    // 该属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息
  //通过正则表达式匹配ua中是否含有MicroMessenger字符串
  if(ua.match(/MicroMessenger/i) == 'micromessenger'){
    return true;
  }else{
    return false;
  }
}</pre></body></html>