saltfish 0.2.1 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -3926,13 +3926,8 @@ const _TranscriptManager = class _TranscriptManager {
|
|
|
3926
3926
|
this.updateCCButtonState(true);
|
|
3927
3927
|
this.createTranscriptUI();
|
|
3928
3928
|
this.chunks = transcript.chunks || [];
|
|
3929
|
-
if (this.chunks.length > 0) {
|
|
3930
|
-
log(`TranscriptManager: Loading chunks - First word: "${this.chunks[0].text}", Total chunks: ${this.chunks.length}`);
|
|
3931
|
-
log(`TranscriptManager: Full text: "${transcript.text}"`);
|
|
3932
|
-
}
|
|
3933
3929
|
this.isNewVideo = true;
|
|
3934
3930
|
this.firstWordForceDisplayUntil = Date.now() + 500;
|
|
3935
|
-
log(`TranscriptManager: New video loaded, forcing first word display until ${this.firstWordForceDisplayUntil}`);
|
|
3936
3931
|
this.setupWordDisplay();
|
|
3937
3932
|
if (_TranscriptManager.userCaptionPreference !== null) {
|
|
3938
3933
|
this.isVisible = _TranscriptManager.userCaptionPreference;
|
|
@@ -3982,7 +3977,6 @@ const _TranscriptManager = class _TranscriptManager {
|
|
|
3982
3977
|
* Handle video time updates for transcript synchronization
|
|
3983
3978
|
*/
|
|
3984
3979
|
handleTimeUpdate(_event) {
|
|
3985
|
-
var _a;
|
|
3986
3980
|
if (!this.currentTranscript || !this.isVisible || !this.videoElement || this.chunks.length === 0) {
|
|
3987
3981
|
return;
|
|
3988
3982
|
}
|
|
@@ -3990,17 +3984,10 @@ const _TranscriptManager = class _TranscriptManager {
|
|
|
3990
3984
|
let activeChunkIndex = this.findActiveChunkIndex(currentTime);
|
|
3991
3985
|
const now = Date.now();
|
|
3992
3986
|
if (this.isNewVideo && now < this.firstWordForceDisplayUntil && this.chunks.length > 0) {
|
|
3993
|
-
log(`TranscriptManager: Forcing first word display (time=${currentTime.toFixed(3)}s, remaining=${this.firstWordForceDisplayUntil - now}ms)`);
|
|
3994
3987
|
activeChunkIndex = 0;
|
|
3995
3988
|
} else if (this.isNewVideo && now >= this.firstWordForceDisplayUntil) {
|
|
3996
3989
|
this.isNewVideo = false;
|
|
3997
3990
|
}
|
|
3998
|
-
if (((_a = this.chunks[0]) == null ? void 0 : _a.text) === " Here" && activeChunkIndex >= 0 && activeChunkIndex < this.chunks.length) {
|
|
3999
|
-
const activeChunk = this.chunks[activeChunkIndex];
|
|
4000
|
-
if (activeChunk.text !== " Here" && currentTime < 0.5) {
|
|
4001
|
-
log(`TranscriptManager DEBUG: Time=${currentTime.toFixed(3)}s, Expected "Here" but showing index ${activeChunkIndex}: "${activeChunk.text}"`);
|
|
4002
|
-
}
|
|
4003
|
-
}
|
|
4004
3991
|
this.updateIntelligentWordDisplay(activeChunkIndex);
|
|
4005
3992
|
}
|
|
4006
3993
|
/**
|
|
@@ -4090,11 +4077,6 @@ const _TranscriptManager = class _TranscriptManager {
|
|
|
4090
4077
|
const showTwoWords = this.shouldShowTwoWords(currentIndex);
|
|
4091
4078
|
const currentChunk = currentIndex >= 0 && currentIndex < this.chunks.length ? this.chunks[currentIndex] : null;
|
|
4092
4079
|
const nextChunk = showTwoWords && currentIndex + 1 < this.chunks.length ? this.chunks[currentIndex + 1] : null;
|
|
4093
|
-
if (currentChunk) {
|
|
4094
|
-
const duration = currentChunk.end - currentChunk.start;
|
|
4095
|
-
const length = currentChunk.text.trim().length;
|
|
4096
|
-
log(`TranscriptManager: Word "${currentChunk.text}", duration: ${duration.toFixed(2)}s, length: ${length}, showTwoWords: ${showTwoWords}, nextWord: "${(nextChunk == null ? void 0 : nextChunk.text) || "none"}"`);
|
|
4097
|
-
}
|
|
4098
4080
|
this.transcriptContent.innerHTML = "";
|
|
4099
4081
|
if (!currentChunk) {
|
|
4100
4082
|
return;
|