From f4a13dc858ec94481f992cae4eb44c232a4f3e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1rio=20Panenko?= Date: Mon, 4 Nov 2024 21:12:21 +0000 Subject: [PATCH] fixed --- Script_Speech_recognition/videoplayer.js | 5 +++++ 1 file changed, 5 insertions(+) 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++;