Forum Discussion
Add trigger to player controls
All,
How do I attach a trigger to execute JavaScript when the user clicks the player play/pause button?
- WaltHamiltonSuper Hero
It’s a built-in object with triggers you can’t access. You might try a combination of putting a shape over it to initiate the action you want, the creating triggers to duplicate the built-in actions. I think it would be rather tricky.
I'm not sure how you're designing the slide and at what point they click the play/pause button or what happens if they click it multiple times.
- One option is to use a timeline trigger.
- Create a trigger to pause the timeline when the slide starts.
- Then when the user clicks the play button the timeline resumes.
- Add a trigger to execute JS when timeline reaches .1 seconds.
Just tested it and it looks like it would work.
https://360.articulate.com/review/content/afde40b0-87aa-4e6b-a16f-f260825e153d/review
- AndrewTeasda876Community Member
Tom and Walt, appreciate the comments.
I have a javaScript function that runs when the timeline starts, the function starts a timer that tracks how long the user is on the page. If the user clicks the storyline player pause button, I'd like the timer to pause as well (and then restart when the user selects play). I just need to know if there's a trigger that fires to which I can attach the JavaScript command.
Walt - "it's a built-in object with triggers you can't access" is the answer I was worried I'd hear.