Problem with External component (transcription)

rbaumgartner6410 Community Member Posts: 1
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:


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.


  • ssneg
    ssneg Community Member Posts: 1,466 ☆ Roadie ☆
    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 > PlayButton.jpg > IF MyLectoraVariable contains "over"

    Hope this helps.