mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
bump dev version
This commit is contained in:
parent
6daced8387
commit
48a576778f
28 changed files with 443 additions and 326 deletions
|
@ -12,23 +12,97 @@
|
|||
//AndroidFullScreen.isSupported();
|
||||
|
||||
//// Is immersive mode supported?
|
||||
//AndroidFullScreen.isImmersiveModeSupported(successFunction, errorFunction);
|
||||
//AndroidFullScreen.isImmersiveModeSupported(onSuccess, onError);
|
||||
|
||||
//// The width of the screen in immersive mode
|
||||
//AndroidFullScreen.immersiveWidth(trace, errorFunction);
|
||||
//AndroidFullScreen.immersiveWidth(trace, onError);
|
||||
|
||||
//// The height of the screen in immersive mode
|
||||
//AndroidFullScreen.immersiveHeight(trace, errorFunction);
|
||||
//AndroidFullScreen.immersiveHeight(trace, onError);
|
||||
|
||||
//// Hide system UI until user interacts
|
||||
//AndroidFullScreen.leanMode(successFunction, errorFunction);
|
||||
//AndroidFullScreen.leanMode(onSuccess, onError);
|
||||
|
||||
//// Show system UI
|
||||
//AndroidFullScreen.showSystemUI(successFunction, errorFunction);
|
||||
//AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||
|
||||
//// Extend your app underneath the system UI (Android 4.4+ only)
|
||||
//AndroidFullScreen.showUnderSystemUI(successFunction, errorFunction);
|
||||
//AndroidFullScreen.showUnderSystemUI(onSuccess, onError);
|
||||
|
||||
//// Hide system UI and keep it hidden (Android 4.4+ only)
|
||||
//AndroidFullScreen.immersiveMode(successFunction, errorFunction);
|
||||
//AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||
|
||||
var currentPlayer;
|
||||
|
||||
function onPlaybackStart(e, state) {
|
||||
|
||||
var player = this;
|
||||
|
||||
if (player.isLocalPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||
AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||
}
|
||||
}
|
||||
|
||||
function onPlaybackStopped(e, state) {
|
||||
|
||||
var player = this;
|
||||
|
||||
if (player.isLocalPlayer && state.NowPlayingItem && state.NowPlayingItem.MediaType == 'Video') {
|
||||
AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||
}
|
||||
}
|
||||
|
||||
function bindToPlayer(player) {
|
||||
|
||||
releaseCurrentPlayer();
|
||||
|
||||
currentPlayer = player;
|
||||
|
||||
if (!player.isLocalPlayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(player).on('playbackstart.fullscreen', onPlaybackStart)
|
||||
.on('playbackstop.fullscreen', onPlaybackStopped);
|
||||
}
|
||||
|
||||
function releaseCurrentPlayer() {
|
||||
|
||||
if (currentPlayer) {
|
||||
|
||||
$(currentPlayer).off('.fullscreen');
|
||||
}
|
||||
}
|
||||
|
||||
function updateFromSetting(leaveFullScreen) {
|
||||
|
||||
if (AppSettings.enableFullScreen()) {
|
||||
AndroidFullScreen.immersiveMode(onSuccess, onError);
|
||||
}
|
||||
else if (leaveFullScreen) {
|
||||
AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||
}
|
||||
}
|
||||
|
||||
Dashboard.ready(function () {
|
||||
|
||||
console.log('binding fullscreen to MediaController');
|
||||
|
||||
$(MediaController).on('playerchange', function () {
|
||||
|
||||
bindToPlayer(MediaController.getCurrentPlayer());
|
||||
});
|
||||
|
||||
bindToPlayer(MediaController.getCurrentPlayer());
|
||||
|
||||
updateFromSetting(false);
|
||||
|
||||
$(AppSettings).on('settingupdated', function (e, key) {
|
||||
|
||||
if (key == 'enableFullScreen') {
|
||||
updateFromSetting(true);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
})();
|
Loading…
Add table
Add a link
Reference in a new issue