Fix loading Thrimbletrimmer and defaulting initial chapter time (#361)

pull/363/head
ElementalAlchemist 1 year ago committed by GitHub
parent d979b40d9f
commit 179f06b413
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -639,10 +639,16 @@ async function initializeVideoInfo() {
const chapterDescField = document.getElementById( const chapterDescField = document.getElementById(
"range-definition-chapter-marker-first-description", "range-definition-chapter-marker-first-description",
); );
let chapterStartValue = 0;
let chapterDescValue = "";
if (chapterData.length > 0) {
chapterStartValue = chapterData[0].start;
chapterDescValue = chapterData[0].description;
}
chapterStartField.value = videoHumanTimeFromVideoPlayerTime( chapterStartField.value = videoHumanTimeFromVideoPlayerTime(
chapterData[currentChapterIndex].start - rangeStartOffset + startPlayerTime, chapterStartValue - rangeStartOffset + startPlayerTime,
); );
chapterDescField.value = chapterData[currentChapterIndex].description; chapterDescField.value = chapterDescValue;
currentChapterIndex++; currentChapterIndex++;
} }

Loading…
Cancel
Save