hbuilderX打包app,wap2app,横屏
下面是app.js 的全部代码 大部分代码 都是 在 Hbuilder 创建项目的时候 自动生成的 主要还是 fullScreenOfAndroid ,fullScreenOfIos 这两个 function
App({options: {debug: false},/*** 当wap2app初始化完成时,会触发 onLaunch*/onLaunch: function() {console.log('launch');},/*** 当wap2app启动,或从后台进入前台显示,会触发 onShow*/onShow: function() {console.log('show');},/*** 当wap2app从前台进入后台,会触发 onHide*/onHide: function() {console.log('hide');};var fullScreenOfAndroid = function() {if(true) {var playym = plus.webview.currentWebview();playym.setStyle({videoFullscreen: 'landscape'})} else {document.addEventListener('webkitfullscreenchange', function() {var el = document.webkitFullscreenElement;if(el) {plus.screen.lockOrientation('landscape')} else {plus.screen.unlockOrientation()}})}};var fullScreenOfIos = function(videoElem) {videoElem.addEventListener('webkitbeginfullscreen', function() {plus.screen.lockOrientation('landscape')});videoElem.addEventListener('webkitendfullscreen', function() {plus.screen.unlockOrientation()})};});
Page('appid', { //首页扩展配置onShow: function() {},onClose: function() {}
});