|
|
@ -55,13 +55,14 @@ export function TimeAction(props: Props) { |
|
|
|
hasHours |
|
|
|
hasHours |
|
|
|
); |
|
|
|
); |
|
|
|
const duration = formatSeconds(videoTime.duration, hasHours); |
|
|
|
const duration = formatSeconds(videoTime.duration, hasHours); |
|
|
|
const timeLeft = formatSeconds( |
|
|
|
const remaining = formatSeconds( |
|
|
|
(videoTime.duration - videoTime.time) / mediaPlaying.playbackSpeed, |
|
|
|
(videoTime.duration - videoTime.time) / mediaPlaying.playbackSpeed, |
|
|
|
hasHours |
|
|
|
hasHours |
|
|
|
); |
|
|
|
); |
|
|
|
const timeFinished = new Date( |
|
|
|
const timeFinished = new Date( |
|
|
|
new Date().getTime() + |
|
|
|
new Date().getTime() + |
|
|
|
(videoTime.duration * 1000) / mediaPlaying.playbackSpeed |
|
|
|
((videoTime.duration - videoTime.time) * 1000) / |
|
|
|
|
|
|
|
mediaPlaying.playbackSpeed |
|
|
|
); |
|
|
|
); |
|
|
|
const formattedTimeFinished = ` - ${t("videoPlayer.finishAt", { |
|
|
|
const formattedTimeFinished = ` - ${t("videoPlayer.finishAt", { |
|
|
|
timeFinished, |
|
|
|
timeFinished, |
|
|
@ -76,10 +77,10 @@ export function TimeAction(props: Props) { |
|
|
|
formattedTime = `${currentTime} ${props.noDuration ? "" : `/ ${duration}`}`; |
|
|
|
formattedTime = `${currentTime} ${props.noDuration ? "" : `/ ${duration}`}`; |
|
|
|
} else if (timeFormat === VideoPlayerTimeFormat.REMAINING && !isMobile) { |
|
|
|
} else if (timeFormat === VideoPlayerTimeFormat.REMAINING && !isMobile) { |
|
|
|
formattedTime = `${t("videoPlayer.timeLeft", { |
|
|
|
formattedTime = `${t("videoPlayer.timeLeft", { |
|
|
|
timeLeft, |
|
|
|
timeLeft: remaining, |
|
|
|
})}${videoTime.time === videoTime.duration ? "" : formattedTimeFinished} `;
|
|
|
|
})}${videoTime.time === videoTime.duration ? "" : formattedTimeFinished} `;
|
|
|
|
} else if (timeFormat === VideoPlayerTimeFormat.REMAINING && isMobile) { |
|
|
|
} else if (timeFormat === VideoPlayerTimeFormat.REMAINING && isMobile) { |
|
|
|
formattedTime = `-${timeLeft}`; |
|
|
|
formattedTime = `-${remaining}`; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
formattedTime = ""; |
|
|
|
formattedTime = ""; |
|
|
|
} |
|
|
|
} |
|
|
|