mirror of
https://gitea.invidious.io/iv-org/invidious.git
synced 2024-08-15 00:53:41 +00:00
Player: Fix playback position of already watched videos (#4731)
Trying to watch an already watched video will make the video start 15 seconds before the end. This is not very comfortable when listening to music or watching/listening playlists over and over. This can be easily tested on any instance with the "Save playback position" enabled in the Preferences. Closes issue 3976
This commit is contained in:
commit
09bf09befe
1 changed files with 6 additions and 1 deletions
|
@ -351,7 +351,12 @@ if (video_data.params.save_player_pos) {
|
||||||
const rememberedTime = get_video_time();
|
const rememberedTime = get_video_time();
|
||||||
let lastUpdated = 0;
|
let lastUpdated = 0;
|
||||||
|
|
||||||
if(!hasTimeParam) set_seconds_after_start(rememberedTime);
|
if(!hasTimeParam) {
|
||||||
|
if (rememberedTime >= video_data.length_seconds - 20)
|
||||||
|
set_seconds_after_start(0);
|
||||||
|
else
|
||||||
|
set_seconds_after_start(rememberedTime);
|
||||||
|
}
|
||||||
|
|
||||||
player.on('timeupdate', function () {
|
player.on('timeupdate', function () {
|
||||||
const raw = player.currentTime();
|
const raw = player.currentTime();
|
||||||
|
|
Loading…
Reference in a new issue