mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
3.0.5666.2
This commit is contained in:
parent
17a0f1578d
commit
8030454e19
13 changed files with 175 additions and 137 deletions
52
dashboard-ui/cordova/android/immersive.js
vendored
52
dashboard-ui/cordova/android/immersive.js
vendored
|
@ -32,51 +32,6 @@
|
|||
//// Hide system UI and keep it hidden (Android 4.4+ only)
|
||||
//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') {
|
||||
|
||||
if (!AppSettings.enableFullScreen()) {
|
||||
AndroidFullScreen.showSystemUI(onSuccess, onError);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function bindToPlayer(player) {
|
||||
|
||||
releaseCurrentPlayer();
|
||||
|
||||
currentPlayer = player;
|
||||
|
||||
if (!player.isLocalPlayer) {
|
||||
return;
|
||||
}
|
||||
|
||||
$(player).on('playbackstart', onPlaybackStart)
|
||||
.on('playbackstop', onPlaybackStopped);
|
||||
}
|
||||
|
||||
function releaseCurrentPlayer() {
|
||||
|
||||
if (currentPlayer) {
|
||||
|
||||
$(currentPlayer).off('playbackstart', onPlaybackStart).off('playbackstop', onPlaybackStopped);
|
||||
}
|
||||
}
|
||||
|
||||
function updateFromSetting(leaveFullScreen) {
|
||||
|
||||
if (AppSettings.enableFullScreen()) {
|
||||
|
@ -91,13 +46,6 @@
|
|||
|
||||
Logger.log('binding fullscreen to MediaController');
|
||||
|
||||
$(MediaController).on('playerchange', function () {
|
||||
|
||||
bindToPlayer(MediaController.getCurrentPlayer());
|
||||
});
|
||||
|
||||
bindToPlayer(MediaController.getCurrentPlayer());
|
||||
|
||||
updateFromSetting(false);
|
||||
|
||||
$(AppSettings).on('settingupdated', function (e, key) {
|
||||
|
|
24
dashboard-ui/cordova/android/vlcplayer.js
vendored
24
dashboard-ui/cordova/android/vlcplayer.js
vendored
|
@ -95,11 +95,22 @@
|
|||
return;
|
||||
}
|
||||
|
||||
var tIndex = val.indexOf('#t=');
|
||||
var startPosMs = 0;
|
||||
|
||||
if (tIndex != -1) {
|
||||
startPosMs = val.substring(tIndex + 3);
|
||||
startPosMs = parseFloat(startPosMs) * 1000;
|
||||
}
|
||||
|
||||
if (options.type == 'audio') {
|
||||
|
||||
AndroidVlcPlayer.playAudioVlc(val, JSON.stringify(item), JSON.stringify(mediaSource), posterUrl);
|
||||
} else {
|
||||
AndroidVlcPlayer.playVideoVlc(val, JSON.stringify(item), JSON.stringify(mediaSource), posterUrl);
|
||||
|
||||
var playbackStartInfo = {};
|
||||
|
||||
AndroidVlcPlayer.playVideoVlc(val, startPosMs, item.Name, JSON.stringify(mediaSource), JSON.stringify(playbackStartInfo));
|
||||
}
|
||||
|
||||
playerState.currentSrc = val;
|
||||
|
@ -175,6 +186,17 @@
|
|||
return deferred.promise();
|
||||
};
|
||||
|
||||
self.onActivityClosed = function (wasStopped, hasError, endPositionMs) {
|
||||
|
||||
playerState.currentTime = endPositionMs;
|
||||
|
||||
if (wasStopped) {
|
||||
MediaPlayer.stop(false);
|
||||
}
|
||||
|
||||
self.report('playbackstop', playerState.duration, endPositionMs, false, 100);
|
||||
};
|
||||
|
||||
window.AudioRenderer.Current = self;
|
||||
window.VideoRenderer.Current = self;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue