diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 9fbb2c84ac..ba97ebd56b 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -182,7 +182,7 @@ import { appRouter } from '../../../components/appRouter'; 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('.btnNextChapter').classList.remove('hide'); } else { @@ -553,7 +553,7 @@ import { appRouter } from '../../../components/appRouter'; const player = this; currentRuntimeTicks = playbackManager.duration(player); 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; refreshProgramInfoIfNeeded(player, item); showComingUpNextIfNeeded(player, item, currentTime, currentRuntimeTicks); @@ -648,7 +648,7 @@ import { appRouter } from '../../../components/appRouter'; btnRewind.disabled = !playState.CanSeek; const nowPlayingItem = state.NowPlayingItem || {}; 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); if (state.MediaSource && state.MediaSource.SupportsTranscoding && supportedCommands.indexOf('SetMaxStreamingBitrate') !== -1) { @@ -690,7 +690,7 @@ import { appRouter } from '../../../components/appRouter'; return (currentTimeMs - programStartDateMs) / programRuntimeMs * 100; } - function updateTimeDisplay(positionTicks, runtimeTicks, playbackStartTimeTicks, bufferedRanges) { + function updateTimeDisplay(positionTicks, runtimeTicks, playbackStartTimeTicks, playbackRate, bufferedRanges) { if (enableProgressByTimeOfDay) { if (nowPlayingPositionSlider && !nowPlayingPositionSlider.dragging) { if (programStartDateMs && programEndDateMs) { @@ -725,8 +725,8 @@ import { appRouter } from '../../../components/appRouter'; nowPlayingPositionSlider.value = 0; } - if (runtimeTicks && positionTicks != null && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && currentItem.Type !== 'Recording') { - endsAtText.innerHTML = '    ' + mediaInfo.getEndsAtFromPosition(runtimeTicks, positionTicks, true); + if (runtimeTicks && positionTicks != null && currentRuntimeTicks && !enableProgressByTimeOfDay && currentItem.RunTimeTicks && currentItem.Type !== 'Recording' && playbackRate !== null) { + endsAtText.innerHTML = '    ' + mediaInfo.getEndsAtFromPosition(runtimeTicks, positionTicks, playbackRate, true); } else { endsAtText.innerHTML = ''; } @@ -911,8 +911,7 @@ import { appRouter } from '../../../components/appRouter'; actionsheet.show({ items: menuItems, title: globalize.translate('Audio'), - positionTo: positionTo, - enableHistory: false + positionTo: positionTo }).then(function (id) { const index = parseInt(id); @@ -958,8 +957,7 @@ import { appRouter } from '../../../components/appRouter'; actionsheet.show({ title: globalize.translate('Subtitles'), items: menuItems, - positionTo: positionTo, - enableHistory: false + positionTo: positionTo }).then(function (id) { const index = parseInt(id);