jellyfin-web/dashboard-ui/cordova/android/immersive.js

59 lines
1.6 KiB
JavaScript
Raw Normal View History

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