Explore the community Forums Lectora Lectora Questions & Answers Stopping then playing the same audio clip

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #391931 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    There must be a simple way of doing this but, unexpectedly, it does not work

    I want students to play an audio clip. At the moment if they multiple click the play button I have created, they will initiate multiple plays of the clip simultaneously e.g. they click three times on the button, they will hear 3 playbacks all offset in relation to one another – very messy.

    So…

    I wrote this

    onmclick stop clip
    onmclick play clip

    I would expect this to stop the clip if it is playing, then play the clip.

    BUT… that does not work and nothing is played. Nothing happens.

    I suppose I could disable/hide the button until the clip is played etc. but that would add a complication and also force the student to listen to the entire clip (unless I create a stop button etc.). I could just use a toggle but would prefer to start playback from the beginning. I could show a player but would prefer not to.

    There must be a way of doing this simply without resorting to JS. Seems like a lot of trouble but maybe there is no option.

    Thanks for any thoughts.

    #391933 Score: 0
    Profile photo of Andrew Lian
    Andrew Lian
    Member
    beginner
    intermediate
    friend finder
    advanced
    contributor
    wise owl
    curious george
    profile
    12 pts
    @mlapl1

    ok. I fixed it by toggling a variable – but it seems like a lot of work for something that should be quite simple – and I have to re-link a file several times (unless I use a change contents strategy).

    #391996 Score: 0
    Profile photo of Jason Dalrymple
    Jason Dalrymple
    Member
    beginner
    intermediate
    profile
    wise owl
    curious george
    contributor
    friend finder
    advanced
    picture perfect
    47 pts
    @JasonADal

    Hi Andrew – With all the work I’ve been doing to get audio to play the ways I want to, I could take a look at a sample if you have one and work something out. The unfortunate piece is that most of the solutions I’ve had to use do involve JavaScript (see my post about playing specific sections based on user clicks).

    #392001 Score: 0
    Profile photo of Tim K
    Tim K
    Member
    contributor
    beginner
    intermediate
    advanced
    friend finder
    junior moderator
    advocate
    wise owl
    curious george
    Group Member
    329 pts
    @timk

    Is there anything else happening with the audio on that page or with the button? Which version do you have? I tested a button to “Stop” and “Play” and it’s working without issues, i.e. always playing the audio from the beginning, in Lectora 17.1.3 and 16.1.2.

    Try to put a short delay on the “Play” action, in case the Stop command isn’t finished before the “Play” comes.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.