• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers

Change state of custom Play/Pause button when timeline stops

New Here ,
Aug 13, 2021 Aug 13, 2021

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?

Views

149

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Engaged , Aug 31, 2021 Aug 31, 2021

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

...

Likes

Translate

Translate
Community Expert ,
Aug 13, 2021 Aug 13, 2021

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? 

http://blog.lilybiri.com/pausing-captivates-timeline

Custom Play/Pause button

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 15, 2021 Aug 15, 2021

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. 

 

 

 

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Aug 16, 2021 Aug 16, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Aug 16, 2021 Aug 16, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Engaged ,
Aug 31, 2021 Aug 31, 2021

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.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Sep 14, 2021 Sep 14, 2021

Copy link to clipboard

Copied

LATEST

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

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines