Added default value for get_video_time() which was causing a bug in safari

This commit is contained in:
bbielsa 2021-10-26 18:43:28 -04:00 committed by Emilien Devos
parent 1261323c66
commit b6792cf02e

View File

@ -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;