diff --git a/Script_Speech_recognition/videoplayer.js b/Script_Speech_recognition/videoplayer.js index a22d3ad..e983cc0 100644 --- a/Script_Speech_recognition/videoplayer.js +++ b/Script_Speech_recognition/videoplayer.js @@ -48,10 +48,15 @@ async function loadVideoSequenceByLetters() { function playVideoAtIndex(index) { if (index < 0 || index >= videoSequence.length) return; + videoPlayer.src = videoSequence[index]; videoPlayer.play(); currentIndex = index; + // Update the title with the current letter or word + const currentChar = videoSequence[index].split('/').pop().split('.')[0]; // Extract letter from the video path + document.getElementById('currentLetter').innerText = `${currentChar.toUpperCase()}`; // Update text + if (autoPlayEnabled) { videoPlayer.onended = () => { currentIndex++;