mirror of
https://gitea.invidious.io/iv-org/invidious-copy-2022-04-11.git
synced 2024-08-15 00:43:26 +00:00
Added default value for get_video_time() which was causing a bug in safari
This commit is contained in:
parent
1261323c66
commit
b6792cf02e
1 changed files with 5 additions and 3 deletions
|
@ -207,7 +207,7 @@ if (video_data.params.remember_position) {
|
|||
|
||||
set_seconds_after_start(remeberedTime);
|
||||
|
||||
player.on("timeupdate", e => {
|
||||
const updateTime = () => {
|
||||
const raw = player.currentTime();
|
||||
const time = Math.floor(raw);
|
||||
|
||||
|
@ -215,7 +215,9 @@ if (video_data.params.remember_position) {
|
|||
save_video_time(time);
|
||||
lastUpdated = time;
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
player.on("timeupdate", updateTime);
|
||||
}
|
||||
else {
|
||||
remove_all_video_times();
|
||||
|
@ -372,7 +374,7 @@ function get_video_time() {
|
|||
const all_video_times = get_all_video_times();
|
||||
const timestamp = all_video_times[videoId];
|
||||
|
||||
return timestamp;
|
||||
return timestamp || 0;
|
||||
}
|
||||
catch {
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue