Copy link to clipboard
Copied
I have created a custome Play/Pause button in Captivate 2019 and I have placed it in the first slide with timing 'Rest of Project' and Pause After is unchecked. Now there are other buttons in individual slides which are paused after a certain time in the slides (for example, after the audio is over in each of the slide, a button appears and wait for the user to click it). I am not able to manipulate the custom Play/Pause button state when the timeline is paused - it should change to Paused state. Means, when the timeline is paused, the custom Play/Pause button should change its state and toggle when again timeline starts playing. Any idea please? Can this be done?
You can use Captivate's js api to set up event listeners that would capture the events for pausing and resuming, and then do things whenever that happens (e.g. change your play/pause button state), and also write the current play/pause state to a user variable that wold at any time reflect if the movie is currently playing or paused, to be quried beween the actual events (much like an Info System Variable).
Say you have a custom play/paused button labeled 'playPauseButton' with two states named
...Copy link to clipboard
Copied
This would be very complicated, mixing a custom Play/Pause button with using pausing points from interactive objects. One of the reasons is that the behavior of objects is not completely the same for the absolute PAUSE (which is used in your Pause buttonà and pausing points. Did you know that?
Copy link to clipboard
Copied
Thanks for replying.
I do know and understand that "behavior of objects is not completely the same for the absolute PAUSE". I have created all custom navigation buttons but facing difficulties in replicating the behavior of Captivate default play/pause button in my custom Play/Pause button. Because Captivate Play/Pause button not only pauses when there is a pause given in slides, but also toggles itself.
A custom Play/Pause button can be placed in the first slide or in Master slide. We also need individual slides to be paused to do the interactivities. So when a click button in a slide pauses the timeline, if the custom Play/Pause button state can't be changed/toggled (as happens to Captivate default play/pause button), it will surely mislead the learners.
Copy link to clipboard
Copied
If you looked at the links I posted you'll see that I have warned about that. If you want the custom Play/Pause button to behave fully as the one built in the playbar, you'll need to use JS to extend its functionality. You will need to add lot of event handlers to take care of all the possible external causes of pausing.
Copy link to clipboard
Copied
Thank you.... trying to find out in JavaScript how to capture the event when the objects getting paused in Captivate. If it can be captured, then the custom Play/Pause button also can be manipulated.
Copy link to clipboard
Copied
You can use Captivate's js api to set up event listeners that would capture the events for pausing and resuming, and then do things whenever that happens (e.g. change your play/pause button state), and also write the current play/pause state to a user variable that wold at any time reflect if the movie is currently playing or paused, to be quried beween the actual events (much like an Info System Variable).
Say you have a custom play/paused button labeled 'playPauseButton' with two states named 'Playing' and 'Paused', and you created a boolean user variable 'v_isPaused' that is supposed to have the value 'false' when the movie is playing and 'true' when the movie is paused. Put this on an 'On Enter' action on the first slide:
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIESTART',setIsPlaying);
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIEPAUSE',setIsPaused);
window.cpAPIEventEmitter.addEventListener('CPAPI_MOVIERESUME',setIsPlaying);
function setIsPaused() {
v_isPaused = true;
cp.changeState('playPauseButton','Paused');
}
function setIsPlaying() {
v_isPaused = false;
cp.changeState('playPauseButton','Playing');
}
That should take care of the correct state change of the button, no matter by which means the slide was paused/resumed.
You can built out the action that would toggle the 'playPauseButton' between pausing and resuming the slide as conditional, depending on the current value of the 'v_isPaused' variable.
Copy link to clipboard
Copied
Hi Gaanf,
Excellent solution. Thank you very much.
Common Javascript interface has given more power to developers to create bespoke solutions in Captivate. I am still exploring, but seems almost everything can be customized now. Just awesome.
Learn about the Common JavaScript interface for Adobe Captivate