let connection = navigator.connection || navigator.mozConnection || navigator.webkitConnection || { effectiveType: undefined };
console.log(connection.effectiveType);
// 4g wifi......
open -a Simulator
Mac OS 打开Androidn虚拟机
参考网址:https://mumu.163.com/mac/index.html
在video标签上加上这三个属性
x5-playsinline="true" // 解决Android中微信内置浏览器打开默认全屏 webkit-playsinline="true" //解决IOS中播放视频时会默认全屏展示 playsinline="true"
videoDom.play(); // 播放
videoDom.pause(); // 暂停
// 全屏
if (this.videoDom.requestFullScreen) {
this.videoDom.requestFullScreen();
} else if (this.videoDom.mozRequestFullScreen) {
this.videoDom.mozRequestFullScreen();
} else if (this.videoDom.webkitRequestFullScreen) {
this.videoDom.webkitRequestFullScreen();
} else if (this.videoDom.requestFullscreen) {
this.videoDom.requestFullScreen();
} else if (this.videoDom.webkitRequestFullscreen) {
this.videoDom.webkitRequestFullscreen();
} else if (this.videoDom.webkitSupportsFullscreen) {
this.videoDom.webkitEnterFullscreen();
}
// IOS中退出全屏事件
this.videoDom.addEventListener(‘webkitendfullscreen‘, function () {
that.videoStatus = false;
});
// Android中退出全屏事件
this.videoDom.addEventListener(‘x5videoexitfullscreen‘, function () {
console.log(‘android video 退出全屏‘);
});
window.onresize = function temp(){
// 做你想做的操作
}
原文:https://www.cnblogs.com/chenwan1218/p/14691534.html