代码语言:javascript复制
var player_flg =false;
//视频初始化完成
player.on('complete', function() {
//$('#mse .xgplayer-fullscreen').trigger("click");
lockOrientation();
})
//强制横屏及全屏
function lockOrientation(){
mui.plusReady(function() {
plus.navigator.setFullscreen(true);
plus.screen.lockOrientation("landscape-primary");
$('#mse .xgplayer-fullscreen').css('display','none');
$("#videoPlayBox").show();
$(".wrap-top").hide();
});
}
//返回
mui.plusReady(function() {
plus.screen.lockOrientation("portrait-primary");
var old_back = mui.back;
mui.back = function(){
if(player_flg){
player.destroy();
plus.screen.lockOrientation("portrait-primary");
$("#videoPlayBox").hide();
$(".wrap-top").show();
player_flg = false;
}else{
console.log("back");
old_back();
}
}
})