Problem with External component (transcription)

I added the external component - html file with audio and trascription on the slide (right collumn on picture). I added also play button and pause button. I call the external component with buttons and JS:

document.getElementById('transcript1').contentWindow.playAudio();

Everything works, but i dont know how to change pause button (hide) to play button (show) when audio in external document finish?

Can anybody help me? Thanks.

18-8-2015-12-17-55.jpg

Discussion (1)

1. In your HTML, using whatever code you use to play sound, set som JS variable to indicate that the playback is over.

2. In Lectora, access the variable with JS, e.g. document.getElementById(‘transcript1′).contentWindow.isItOver.

3. You can use that in two on-timer actions every 0.1 seconds or so:

a) Run JavaScript > VarMyLectoraVariable.set(document.getElementById(‘transcript1′).contentWindow.isItOver).

b) Show undefined IF MyLectoraVariable contains "over"

Hope this helps.

Discussions have been disabled for this post