Forum Discussion
Reset Marker state when audio done
- 5 months ago
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
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.
Thanks Nedim, much appreciated!