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

Make Captivate play again after pausing - with Javascript

Contributor ,
Apr 05, 2018 Apr 05, 2018

I hope I am missing something simple. I have 2 buttons: play_nav and pause_nav. Play_nav is hidden. Both buttons, when clicked call the same javascript function. The function hides the calling button and shows the other. The function is supposed to pause or play the movie.

But...

I can only get the movie to pause, nothing I do will make the movie play again. Below is my code, you can see all the commented out parts are different ways I have tried to make the player start again, but nothing seems to work.

I am using Captivate 2017 on a Mac.

Any ideas would be a great help!

function PLaD_pausePlay(theButton){

    if(theButton=="pause"){

        console.log("**** pause button clicked ****");

        cp.show("play_nav");

        cp.hide("pause_nav");

        cp.movie.pause(cp.ReasonForPause.PLAYBAR_ACTION);

    }else{

        console.log("**** play button clicked  ****");

        // cpCmndPause = false;

        //cp.movie.paused=false;

        //window.cpCmndResume=1; 

        //cpAPIInterface.setVariableValue("cpCmndResume",1);

        // cp.actionChoiceContinueMovie();

        //window.cpAPIInterface.play();

        //cp.playPause(cp.ReasonForPlay.PLAYBAR_ACTION);

        cp.movie.play(cp.ReasonForPlay.PLAYBAR_ACTION);

        cp.hide("play_nav");

        cp.show("pause_nav");

    }

1.4K
Translate
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 , Apr 05, 2018 Apr 05, 2018

Make sure you select the, "continue playing the project" check box for your Play button.

You can then just use:

cp.movie.play();

Translate
LEGEND ,
Apr 05, 2018 Apr 05, 2018

I always use advanced actions and a multistate button to toggle but if you want JS, what is wrong with:

window.cpAPIInterface.play();

window.cpAPIInterface.pause();

Translate
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 ,
Apr 05, 2018 Apr 05, 2018

Make sure you select the, "continue playing the project" check box for your Play button.

You can then just use:

cp.movie.play();

Translate
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
Contributor ,
Apr 06, 2018 Apr 06, 2018

Well, poop. That solved it. That is rather counter-intuitive, if I am explicitly calling cp.movie.play(); it ought to play.

With "continue playing the project" check box checked, you don't even need to call cp.movie.play(); The movie will continue to play because of the checked box.

I think I will file a bug report.

Thanks!

Translate
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 ,
Apr 06, 2018 Apr 06, 2018
LATEST

I was thinking exactly the same thing after posting this. I didn't test whether the "Continue playing...." was the only trigger it needed to fire.

Translate
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
Resources
Help resources