diff --git a/src/components/mediainfo/mediainfo.js b/src/components/mediainfo/mediainfo.js index 717a297246..d27af89f01 100644 --- a/src/components/mediainfo/mediainfo.js +++ b/src/components/mediainfo/mediainfo.js @@ -330,8 +330,8 @@ import '../../elements/emby-button/emby-button'; return null; } - export function getEndsAtFromPosition(runtimeTicks, positionTicks, includeText) { - let endDate = new Date().getTime() + ((runtimeTicks - (positionTicks || 0)) / 10000); + export function getEndsAtFromPosition(runtimeTicks, positionTicks, playbackRate, includeText) { + let endDate = new Date().getTime() + (1 / playbackRate) * ((runtimeTicks - (positionTicks || 0)) / 10000); endDate = new Date(endDate); const displayTime = datetime.getDisplayTime(endDate); diff --git a/src/components/playback/playbackmanager.js b/src/components/playback/playbackmanager.js index 615e775ce9..1cb2ba5a5d 100644 --- a/src/components/playback/playbackmanager.js +++ b/src/components/playback/playbackmanager.js @@ -1960,6 +1960,7 @@ class PlaybackManager { state.PlayState.PositionTicks = getCurrentTicks(player); state.PlayState.PlaybackStartTimeTicks = self.playbackStartTime(player); + state.PlayState.PlaybackRate = self.getPlaybackRate(player); state.PlayState.SubtitleStreamIndex = self.getSubtitleStreamIndex(player); state.PlayState.AudioStreamIndex = self.getAudioStreamIndex(player); diff --git a/src/controllers/playback/video/index.js b/src/controllers/playback/video/index.js index 6744d26d51..2d72403b38 100644 --- a/src/controllers/playback/video/index.js +++ b/src/controllers/playback/video/index.js @@ -545,7 +545,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); @@ -640,7 +640,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) { @@ -682,7 +682,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) { @@ -717,8 +717,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 = ''; }