mirror of
https://github.com/jellyfin/jellyfin-web
synced 2025-03-30 19:56:21 +00:00
Apply suggestions from code review
Fix oopsies Co-authored-by: Dmitry Lyzo <56478732+dmitrylyzo@users.noreply.github.com>
This commit is contained in:
parent
233d168f71
commit
479c071582
1 changed files with 8 additions and 10 deletions
|
@ -182,7 +182,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
view.querySelector('.btnAudio').classList.add('hide');
|
view.querySelector('.btnAudio').classList.add('hide');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (playbackManager.currentItem(player).Chapters.length > 1) {
|
if (currentItem.Chapters.length > 1) {
|
||||||
view.querySelector('.btnPreviousChapter').classList.remove('hide');
|
view.querySelector('.btnPreviousChapter').classList.remove('hide');
|
||||||
view.querySelector('.btnNextChapter').classList.remove('hide');
|
view.querySelector('.btnNextChapter').classList.remove('hide');
|
||||||
} else {
|
} else {
|
||||||
|
@ -553,7 +553,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
const player = this;
|
const player = this;
|
||||||
currentRuntimeTicks = playbackManager.duration(player);
|
currentRuntimeTicks = playbackManager.duration(player);
|
||||||
const currentTime = playbackManager.currentTime(player) * 10000;
|
const currentTime = playbackManager.currentTime(player) * 10000;
|
||||||
updateTimeDisplay(currentTime, currentRuntimeTicks, playbackManager.playbackStartTime(player), playbackManager.getBufferedRanges(player));
|
updateTimeDisplay(currentTime, currentRuntimeTicks, playbackManager.playbackStartTime(player), playbackManager.getPlaybackRate(player), playbackManager.getBufferedRanges(player));
|
||||||
const item = currentItem;
|
const item = currentItem;
|
||||||
refreshProgramInfoIfNeeded(player, item);
|
refreshProgramInfoIfNeeded(player, item);
|
||||||
showComingUpNextIfNeeded(player, item, currentTime, currentRuntimeTicks);
|
showComingUpNextIfNeeded(player, item, currentTime, currentRuntimeTicks);
|
||||||
|
@ -648,7 +648,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
btnRewind.disabled = !playState.CanSeek;
|
btnRewind.disabled = !playState.CanSeek;
|
||||||
const nowPlayingItem = state.NowPlayingItem || {};
|
const nowPlayingItem = state.NowPlayingItem || {};
|
||||||
playbackStartTimeTicks = playState.PlaybackStartTimeTicks;
|
playbackStartTimeTicks = playState.PlaybackStartTimeTicks;
|
||||||
updateTimeDisplay(playState.PositionTicks, nowPlayingItem.RunTimeTicks, playState.PlaybackStartTimeTicks, playState.BufferedRanges || []);
|
updateTimeDisplay(playState.PositionTicks, nowPlayingItem.RunTimeTicks, playState.PlaybackStartTimeTicks, playState.PlaybackRate, playState.BufferedRanges || []);
|
||||||
updateNowPlayingInfo(player, state);
|
updateNowPlayingInfo(player, state);
|
||||||
|
|
||||||
if (state.MediaSource && state.MediaSource.SupportsTranscoding && supportedCommands.indexOf('SetMaxStreamingBitrate') !== -1) {
|
if (state.MediaSource && state.MediaSource.SupportsTranscoding && supportedCommands.indexOf('SetMaxStreamingBitrate') !== -1) {
|
||||||
|
@ -690,7 +690,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
return (currentTimeMs - programStartDateMs) / programRuntimeMs * 100;
|
return (currentTimeMs - programStartDateMs) / programRuntimeMs * 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateTimeDisplay(positionTicks, runtimeTicks, playbackStartTimeTicks, bufferedRanges) {
|
function updateTimeDisplay(positionTicks, runtimeTicks, playbackStartTimeTicks, playbackRate, bufferedRanges) {
|
||||||
if (enableProgressByTimeOfDay) {
|
if (enableProgressByTimeOfDay) {
|
||||||
if (nowPlayingPositionSlider && !nowPlayingPositionSlider.dragging) {
|
if (nowPlayingPositionSlider && !nowPlayingPositionSlider.dragging) {
|
||||||
if (programStartDateMs && programEndDateMs) {
|
if (programStartDateMs && programEndDateMs) {
|
||||||
|
@ -725,8 +725,8 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
nowPlayingPositionSlider.value = 0;
|
nowPlayingPositionSlider.value = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runtimeTicks && positionTicks != null && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && currentItem.Type !== 'Recording') {
|
if (runtimeTicks && positionTicks != null && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && currentItem.Type !== 'Recording' && playbackRate !== null) {
|
||||||
endsAtText.innerHTML = ' ' + mediaInfo.getEndsAtFromPosition(runtimeTicks, positionTicks, true);
|
endsAtText.innerHTML = ' ' + mediaInfo.getEndsAtFromPosition(runtimeTicks, positionTicks, playbackRate, true);
|
||||||
} else {
|
} else {
|
||||||
endsAtText.innerHTML = '';
|
endsAtText.innerHTML = '';
|
||||||
}
|
}
|
||||||
|
@ -911,8 +911,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
actionsheet.show({
|
actionsheet.show({
|
||||||
items: menuItems,
|
items: menuItems,
|
||||||
title: globalize.translate('Audio'),
|
title: globalize.translate('Audio'),
|
||||||
positionTo: positionTo,
|
positionTo: positionTo
|
||||||
enableHistory: false
|
|
||||||
}).then(function (id) {
|
}).then(function (id) {
|
||||||
const index = parseInt(id);
|
const index = parseInt(id);
|
||||||
|
|
||||||
|
@ -958,8 +957,7 @@ import { appRouter } from '../../../components/appRouter';
|
||||||
actionsheet.show({
|
actionsheet.show({
|
||||||
title: globalize.translate('Subtitles'),
|
title: globalize.translate('Subtitles'),
|
||||||
items: menuItems,
|
items: menuItems,
|
||||||
positionTo: positionTo,
|
positionTo: positionTo
|
||||||
enableHistory: false
|
|
||||||
}).then(function (id) {
|
}).then(function (id) {
|
||||||
const index = parseInt(id);
|
const index = parseInt(id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue