jellyfin-web/dashboard-ui/cordova/android/immersive.js
Luke Pulverenti 8030454e19 3.0.5666.2
2015-07-08 12:10:34 -04:00

59 lines
1.6 KiB
JavaScript

(function () {
function onSuccess() {
Logger.log('Immersive mode succeeded');
}
function onError() {
Logger.log('Immersive mode failed');
}
//// Is this plugin supported?
//AndroidFullScreen.isSupported();
//// Is immersive mode supported?
//AndroidFullScreen.isImmersiveModeSupported(onSuccess, onError);
//// The width of the screen in immersive mode
//AndroidFullScreen.immersiveWidth(trace, onError);
//// The height of the screen in immersive mode
//AndroidFullScreen.immersiveHeight(trace, onError);
//// Hide system UI until user interacts
//AndroidFullScreen.leanMode(onSuccess, onError);
//// Show system UI
//AndroidFullScreen.showSystemUI(onSuccess, onError);
//// Extend your app underneath the system UI (Android 4.4+ only)
//AndroidFullScreen.showUnderSystemUI(onSuccess, onError);
//// Hide system UI and keep it hidden (Android 4.4+ only)
//AndroidFullScreen.immersiveMode(onSuccess, onError);
function updateFromSetting(leaveFullScreen) {
if (AppSettings.enableFullScreen()) {
AndroidFullScreen.immersiveMode(onSuccess, onError);
}
else if (leaveFullScreen) {
AndroidFullScreen.showSystemUI(onSuccess, onError);
}
}
Dashboard.ready(function () {
Logger.log('binding fullscreen to MediaController');
updateFromSetting(false);
$(AppSettings).on('settingupdated', function (e, key) {
if (key == 'enableFullScreen') {
updateFromSetting(true);
}
});
});
})();