PageSourceSearch

http://www.bjconasen.com/js/VideoIfrmeReload.js?v=001

js bjconasen.com collected 2026-10-08 05:00:08 UTC 2,123 bytes, 66 lines download raw bytes

1
2//获取窗口宽度
3function getWindowWidth() {
4    var windowWidth = 0;
5    if (typeof (window.innerWidth) == 'number') {
6        windowWidth = window.innerWidth;
7    }
8    else {
9        if (document.documentElement && document.documentElement.clientWidth) {
10            windowWidth = document.documentElement.clientWidth;
11        }
12        else {
13            if (document.body && document.body.clientWidth) {
14                windowWidth = document.body.clientWidth;
15            }
16        }
17    }
18    return windowWidth;
19}
20
21if(phone()||isWeiXin()){
22
23var VideoIframeObj = document.getElementsByName("myvideo");
24if (VideoIframeObj.length > 0) {
25    for (var i = 0; i < VideoIframeObj.length; i++) {
26        var _ddWidth = parseInt(getWindowWidth() * 90 / 100);
27        var _dheight = 180;
28        if (_ddWidth > 0) {
29            _dheight = parseInt(9 * _ddWidth/16)
30        }
31
32        VideoIframeObj[i].style = "width:" + _ddWidth + "px;height:" + _dheight + "px;";
33        VideoIframeObj[i].height = _dheight;
34        VideoIframeObj[i].width = _ddWidth;
35        var videosrc = VideoIframeObj[i].src;
36        var reger = new RegExp("&width=\\d+", "gmi");
37        videosrc = videosrc.replace(reger, "&width=" + _ddWidth);
38        reger = new RegExp("&height=\\d+", "gmi");
39        videosrc = videosrc.replace(reger, "&height=" + _dheight);
40        VideoIframeObj[i].src = videosrc;
41
42    }
43}
44}
45function phone(){
46if((navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i))) {
47  // console.log('移动端');
48  return true;
49} else {
50  // console.log('pc端');
51 return false;
52}
53
54
55    }
56
57
58function isWeiXin(){
59  var ua = window.navigator.userAgent.toLowerCase();    // 该属性包含了浏览器类型、版本、操作系统类型、浏览器引擎类型等信息
60  //通过正则表达式匹配ua中是否含有MicroMessenger字符串
61  if(ua.match(/MicroMessenger/i) == 'micromessenger'){
62    return true;
63  }else{
64    return false;
65  }
66}

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.