mirror of
https://github.com/iv-org/invidious.git
synced 2024-10-01 01:25:56 -04:00
Added default value for get_video_time() which was causing a bug in safari
This commit is contained in:
parent
1261323c66
commit
b6792cf02e
@ -207,7 +207,7 @@ if (video_data.params.remember_position) {
|
|||||||
|
|
||||||
set_seconds_after_start(remeberedTime);
|
set_seconds_after_start(remeberedTime);
|
||||||
|
|
||||||
player.on("timeupdate", e => {
|
const updateTime = () => {
|
||||||
const raw = player.currentTime();
|
const raw = player.currentTime();
|
||||||
const time = Math.floor(raw);
|
const time = Math.floor(raw);
|
||||||
|
|
||||||
@ -215,7 +215,9 @@ if (video_data.params.remember_position) {
|
|||||||
save_video_time(time);
|
save_video_time(time);
|
||||||
lastUpdated = time;
|
lastUpdated = time;
|
||||||
}
|
}
|
||||||
});
|
};
|
||||||
|
|
||||||
|
player.on("timeupdate", updateTime);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
remove_all_video_times();
|
remove_all_video_times();
|
||||||
@ -372,7 +374,7 @@ function get_video_time() {
|
|||||||
const all_video_times = get_all_video_times();
|
const all_video_times = get_all_video_times();
|
||||||
const timestamp = all_video_times[videoId];
|
const timestamp = all_video_times[videoId];
|
||||||
|
|
||||||
return timestamp;
|
return timestamp || 0;
|
||||||
}
|
}
|
||||||
catch {
|
catch {
|
||||||
return 0;
|
return 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user