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.