mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Merge remote-tracking branch 'upstream/master' into focus-fixes
This commit is contained in:
commit
ca4419da4d
26 changed files with 2146 additions and 1996 deletions
|
@ -701,7 +701,7 @@ import 'emby-ratingbutton';
|
|||
|
||||
const player = this;
|
||||
currentRuntimeTicks = playbackManager.duration(player);
|
||||
updateTimeDisplay(playbackManager.currentTime(player), currentRuntimeTicks, playbackManager.getBufferedRanges(player));
|
||||
updateTimeDisplay(playbackManager.currentTime(player) * 10000, currentRuntimeTicks, playbackManager.getBufferedRanges(player));
|
||||
}
|
||||
|
||||
function releaseCurrentPlayer() {
|
||||
|
|
|
@ -1618,11 +1618,7 @@ class PlaybackManager {
|
|||
|
||||
player = player || self._currentPlayer;
|
||||
if (player && !enableLocalPlaylistManagement(player)) {
|
||||
if (player.isLocalPlayer) {
|
||||
return player.seek((ticks || 0) / 10000);
|
||||
} else {
|
||||
return player.seek(ticks);
|
||||
}
|
||||
return player.seek(ticks);
|
||||
}
|
||||
|
||||
changeStream(player, ticks);
|
||||
|
@ -1631,11 +1627,7 @@ class PlaybackManager {
|
|||
self.seekRelative = function (offsetTicks, player) {
|
||||
player = player || self._currentPlayer;
|
||||
if (player && !enableLocalPlaylistManagement(player) && player.seekRelative) {
|
||||
if (player.isLocalPlayer) {
|
||||
return player.seekRelative((ticks || 0) / 10000);
|
||||
} else {
|
||||
return player.seekRelative(ticks);
|
||||
}
|
||||
return player.seekRelative(ticks);
|
||||
}
|
||||
|
||||
const ticks = getCurrentTicks(player) + offsetTicks;
|
||||
|
@ -3219,7 +3211,7 @@ class PlaybackManager {
|
|||
return player.currentTime();
|
||||
}
|
||||
|
||||
return this.getCurrentTicks(player);
|
||||
return this.getCurrentTicks(player) / 10000;
|
||||
}
|
||||
|
||||
nextItem(player = this._currentPlayer) {
|
||||
|
|
|
@ -222,18 +222,10 @@
|
|||
margin: 0;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .btnShuffleQueue {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .volumecontrol {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-mobile .nowPlayingSecondaryButtons .btnRepeat {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.layout-desktop .nowPlayingInfoButtons .btnRepeat,
|
||||
.layout-tv .nowPlayingInfoButtons .btnRepeat {
|
||||
display: none;
|
||||
|
@ -362,7 +354,8 @@
|
|||
border-radius: 0;
|
||||
}
|
||||
|
||||
.nowPlayingInfoButtons .btnRepeat {
|
||||
.nowPlayingInfoButtons .btnRepeat,
|
||||
.nowPlayingInfoButtons .btnRewind {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
margin-left: 0;
|
||||
|
@ -370,7 +363,8 @@
|
|||
font-size: smaller;
|
||||
}
|
||||
|
||||
.nowPlayingInfoButtons .btnShuffleQueue {
|
||||
.nowPlayingInfoButtons .btnShuffleQueue,
|
||||
.nowPlayingInfoButtons .btnFastForward {
|
||||
position: absolute;
|
||||
right: 0;
|
||||
margin-right: 0;
|
||||
|
@ -468,7 +462,6 @@
|
|||
}
|
||||
|
||||
@media all and (max-width: 63em) {
|
||||
.nowPlayingSecondaryButtons .repeatToggleButton,
|
||||
.nowPlayingInfoButtons .playlist .listItemMediaInfo,
|
||||
.nowPlayingInfoButtons .btnStop {
|
||||
display: none !important;
|
||||
|
|
|
@ -134,7 +134,7 @@ function imageUrl(item, options) {
|
|||
function updateNowPlayingInfo(context, state, serverId) {
|
||||
const item = state.NowPlayingItem;
|
||||
const displayName = item ? getNowPlayingNameHtml(item).replace('<br/>', ' - ') : '';
|
||||
if (typeof item !== 'undefined') {
|
||||
if (item) {
|
||||
const nowPlayingServerId = (item.ServerId || serverId);
|
||||
if (item.Type == 'Audio' || item.MediaStreams[0].Type == 'Audio') {
|
||||
const songName = item.Name;
|
||||
|
@ -192,11 +192,11 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
context.querySelector('.nowPlayingPageTitle').classList.add('hide');
|
||||
}
|
||||
|
||||
const url = item ? seriesImageUrl(item, {
|
||||
const url = seriesImageUrl(item, {
|
||||
maxHeight: 300
|
||||
}) || imageUrl(item, {
|
||||
maxHeight: 300
|
||||
}) : null;
|
||||
});
|
||||
|
||||
let contextButton = context.querySelector('.btnToggleContextMenu');
|
||||
// We remove the previous event listener by replacing the item in each update event
|
||||
|
@ -228,18 +228,16 @@ function updateNowPlayingInfo(context, state, serverId) {
|
|||
});
|
||||
});
|
||||
setImageUrl(context, state, url);
|
||||
if (item) {
|
||||
backdrop.setBackdrops([item]);
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (fullItem) {
|
||||
const userData = fullItem.UserData || {};
|
||||
const likes = userData.Likes == null ? '' : userData.Likes;
|
||||
context.querySelector('.nowPlayingPageUserDataButtonsTitle').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
});
|
||||
} else {
|
||||
backdrop.clearBackdrop();
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '';
|
||||
}
|
||||
backdrop.setBackdrops([item]);
|
||||
apiClient.getItem(apiClient.getCurrentUserId(), item.Id).then(function (fullItem) {
|
||||
const userData = fullItem.UserData || {};
|
||||
const likes = userData.Likes == null ? '' : userData.Likes;
|
||||
context.querySelector('.nowPlayingPageUserDataButtonsTitle').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '<button is="emby-ratingbutton" type="button" class="listItemButton paper-icon-button-light" data-id="' + fullItem.Id + '" data-serverid="' + fullItem.ServerId + '" data-itemtype="' + fullItem.Type + '" data-likes="' + likes + '" data-isfavorite="' + userData.IsFavorite + '"><span class="material-icons favorite"></span></button>';
|
||||
});
|
||||
} else {
|
||||
backdrop.clearBackdrop();
|
||||
context.querySelector('.nowPlayingPageUserDataButtons').innerHTML = '';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -332,8 +330,14 @@ export default function () {
|
|||
buttonVisible(context.querySelector('.btnNextTrack'), item != null);
|
||||
buttonVisible(context.querySelector('.btnPreviousTrack'), item != null);
|
||||
if (layoutManager.mobile) {
|
||||
buttonVisible(context.querySelector('.btnRewind'), false);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), false);
|
||||
const playingVideo = playbackManager.isPlayingVideo() && item !== null;
|
||||
const playingAudio = !playbackManager.isPlayingVideo() && item !== null;
|
||||
buttonVisible(context.querySelector('.btnRepeat'), playingAudio);
|
||||
buttonVisible(context.querySelector('.btnShuffleQueue'), playingAudio);
|
||||
buttonVisible(context.querySelector('.btnRewind'), playingVideo);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), playingVideo);
|
||||
buttonVisible(context.querySelector('.nowPlayingSecondaryButtons .btnShuffleQueue'), playingVideo);
|
||||
buttonVisible(context.querySelector('.nowPlayingSecondaryButtons .btnRepeat'), playingVideo);
|
||||
} else {
|
||||
buttonVisible(context.querySelector('.btnRewind'), item != null);
|
||||
buttonVisible(context.querySelector('.btnFastForward'), item != null);
|
||||
|
@ -615,7 +619,7 @@ export default function () {
|
|||
lastUpdateTime = now;
|
||||
const player = this;
|
||||
currentRuntimeTicks = playbackManager.duration(player);
|
||||
updateTimeDisplay(playbackManager.currentTime(player), currentRuntimeTicks);
|
||||
updateTimeDisplay(playbackManager.currentTime(player) * 10000, currentRuntimeTicks);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,8 @@
|
|||
});
|
||||
}
|
||||
|
||||
window.addEventListener('notificationclick', function (event) {
|
||||
/* eslint-disable-next-line no-restricted-globals -- self is valid in a serviceworker environment */
|
||||
self.addEventListener('notificationclick', function (event) {
|
||||
var notification = event.notification;
|
||||
notification.close();
|
||||
|
||||
|
|
|
@ -256,7 +256,7 @@ export default function (options) {
|
|||
/**
|
||||
* Handles zoom changes.
|
||||
*/
|
||||
function onZoomChange(scale, imageEl, slideEl) {
|
||||
function onZoomChange(swiper, scale, imageEl, slideEl) {
|
||||
const zoomImage = slideEl.querySelector('.swiper-zoom-fakeimg');
|
||||
|
||||
if (zoomImage) {
|
||||
|
|
|
@ -741,7 +741,7 @@ class SyncPlayManager {
|
|||
|
||||
const playAtTime = this.lastCommand.When;
|
||||
|
||||
const currentPositionTicks = playbackManager.currentTime();
|
||||
const currentPositionTicks = playbackManager.currentTime() * 10000;
|
||||
// Estimate PositionTicks on server
|
||||
const serverPositionTicks = this.lastCommand.PositionTicks + ((currentTime - playAtTime) + this.timeOffsetWithServer) * 10000;
|
||||
// Measure delay that needs to be recovered
|
||||
|
|
|
@ -256,7 +256,7 @@ import 'flexStyles';
|
|||
const runtimeTicks = playbackManager.duration(options.player);
|
||||
|
||||
if (runtimeTicks) {
|
||||
const timeRemainingTicks = runtimeTicks - playbackManager.currentTime(options.player);
|
||||
const timeRemainingTicks = runtimeTicks - playbackManager.currentTime(options.player) * 10000;
|
||||
|
||||
return Math.round(timeRemainingTicks / 10000);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue