Forum Discussion

TLD's avatar
TLD
Community Member
7 months ago
Solved

Reset Marker state when audio done

Hello! Thanks Tipsqueak for this great video on using audio with markers. As shown at  3:50 in the video, I am using a marker in Storyline 360 to allow learners to play optional audio on a slide. The "Audio from File" option was used to insert the audio onto the marker and the Audio Only option is enabled for the marker. The Normal state of the marker displays a play icon and the Selected state shows a pause icon. As the audio plays, the learner can toggle between pausing and playing and the icon changes appropriately.

The only issue is when the audio is done playing, the pause icon remains displayed but if the learners clicks the marker, it replays the audio (so clicking pause now plays). The icon is now play and, if selected, it pauses the audio (so clicking play now pauses). The functionality is fine (I want the learner to be able to replay the audio if they want) but the functionality is now out of sync with the icon that is displayed. Is there any way to reset the marker state to Normal when the marker audio is done playing? Or another way to fix this? Thanks!

  • In case anyone else runs into this, I found a solution that doesn't involve using JavaScript (for others like me who aren't proficient with code).

    • I set this up using two separate markers- a Play marker and Pause marker.
    • The markers occupy the same place on the slide. 
    • The Play marker is visible, while the Pause marker's initial state is set to Hidden.
    • I added my media to the slide, rather than embedding it within the marker itself.

     

    I used the following triggers:

    Pause Button:

    • Set state of PlayMarker to Normal when the state of PauseMarker is Hidden
    • Pause Audio when the user clicks PauseMarker
    • Set state of PauseMarker to Hidden when the user clicks PauseMarker

     

    Play Button:

    • Play Audio when the user clicks PlayMarker
    • Set state of PlayMarker to Hidden when the user clicks PlayMarker
    • Set state of PauseMarker to Normal when the state of PlayMarker is Hidden

     

    Audio:

    • Set state of PauseMarker to Hidden when Audio completes
    • Set state of PlayMarker to Normal when Audio completes

8 Replies

  • Hi TLD I think you would be able to do this by using a trigger on the media completing. For example, when the audio completes, check the state of the marker to the desired state.

    • TLD's avatar
      TLD
      Community Member

      Thanks Sam - That was my thought also but could not find a way to do it

  • Nedim's avatar
    Nedim
    Community Member

    I don't believe the media states nested inside the marker can be controlled by triggers. To change the state of the icon after the audio completes, the marker content needs to be closed, which requires clicking the marker. In this scenario, I would use a JavaScript solution to target the audio inside the marker, and when the audio finishes, simulate a marker click event to change its state. Maybe something like this:

    I've attached a short video demonstrating this. I hope there is a simpler and better solution that doesn't involve JavaScript, but I just can't figure it out at the moment.

    • TLD's avatar
      TLD
      Community Member

      Thanks Nedim, much appreciated!

    • SamHill's avatar
      SamHill
      Super Hero

      Thanks for jumping in Nedim I think I misunderstood this request. Cheers.

  • NDCB's avatar
    NDCB
    Community Member

    In case anyone else runs into this, I found a solution that doesn't involve using JavaScript (for others like me who aren't proficient with code).

    • I set this up using two separate markers- a Play marker and Pause marker.
    • The markers occupy the same place on the slide. 
    • The Play marker is visible, while the Pause marker's initial state is set to Hidden.
    • I added my media to the slide, rather than embedding it within the marker itself.

     

    I used the following triggers:

    Pause Button:

    • Set state of PlayMarker to Normal when the state of PauseMarker is Hidden
    • Pause Audio when the user clicks PauseMarker
    • Set state of PauseMarker to Hidden when the user clicks PauseMarker

     

    Play Button:

    • Play Audio when the user clicks PlayMarker
    • Set state of PlayMarker to Hidden when the user clicks PlayMarker
    • Set state of PauseMarker to Normal when the state of PlayMarker is Hidden

     

    Audio:

    • Set state of PauseMarker to Hidden when Audio completes
    • Set state of PlayMarker to Normal when Audio completes
    • TLD's avatar
      TLD
      Community Member

      Thanks so much Nathan! This worked perfectly, even with different optional audio on layers within a slide. Your instructions are very clear and easy to follow. MUCH appreciated.