Validate when using slider
All checks were successful
Publish to burnedkirby.com/subtitle / publish-site (push) Successful in 1s

This commit is contained in:
Stephen Seo 2024-07-10 15:41:44 +09:00
parent 5330854ba2
commit 66773d92bd

View file

@ -285,12 +285,16 @@
} else if (value >= subtitles_array.length) { } else if (value >= subtitles_array.length) {
value = subtitles_array.length - 1; value = subtitles_array.length - 1;
} }
// Only when value is valid.
if (value >= 0 && value < subtitles_array.length) {
current_subtitle = value; current_subtitle = value;
time_info.set_time_offset( time_info.set_time_offset(
subtitles_array[current_subtitle].time_start * 1000.0 subtitles_array[current_subtitle].time_start * 1000.0
); );
display_subtitle(); display_subtitle();
set_up_play_anim(); set_up_play_anim();
}
}); });
document.getElementById("left_button").addEventListener( document.getElementById("left_button").addEventListener(