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

Captivate 8 and Javascript Play common interface function

New Here ,
Oct 19, 2016 Oct 19, 2016

I have a weird issue.  I have a slide that prompts for input with a submit button.

The button calls a very simple javascript that checks if the field is blank.  If it is it puts up an alert box explaining the issue and pauses the movie, so the user has a chance to put something in the box before it continues playing.  If it isn't blank it stores the data in a variable and should then continue the movie.

window.cpAPIInterface.pause(); works fine

window.cpAPIInterface.play(); doesn't do anything.

So now the movie pauses at the slide and I can't seem to get it moving again.  If I use

windows.cpAPIInterface.next(); it will skip to the next slide as expected but it stays paused.

I thought maybe it was my scripting since i'm no javascript expert so i created another button and the only line of script is the common interface play command and it also does nothing when pressed.

For reference my goal is using HTML5 output.

For testing I also previewed in standard flash output in which case the play button works, but the none of the functions from the original box and button work.  I'm sure I could accomplish this without javascript but my project requires several instances of similar functions and it will make it a lot easier if I can just call the function each time.  Haven't used Captivate for a few versions so wasn't sure if there was some large javascript changes.

1.2K
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
People's Champ ,
Oct 19, 2016 Oct 19, 2016

I use the pause the same as you but use: window.cpCmndResume = 1; to play the movie again. I must have encountered the same issue as you some time ago, I don't remember. I have the same basic script file I use for all of our courses and they all use the resume command. I do check if at the end of the slide before issuing the command though.

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
New Here ,
Oct 20, 2016 Oct 20, 2016

Thanks for the assistance.  This also did not work.  In fact I have now figured out that pause also does not work.  It always pauses on load since there is a text entry box.  From there its behavior is following the "Continue playing the project" option.  If it's checked it continues regardless of what I do, and if it's unchecked it stays pauses and won't continue.

It's processing all of my other script.  Alert boxes show up, or if I set a variable in a text caption it changes accordingly, but its like it's ignoring any play controls.

I've tried window.cpAPIInterface.pause()/play()

I've tried window.cpCmndResume = 1

I've tried cp.setvariable("rdcmndResume","1")

Nothing seems to be working.  Guess maybe I should try and get it working with internal captivate controls but since I plan to take everything collected and dump it into a google sheet I really need to figure out why javascript is not playing along nicely.

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

Did you ever get this working? I am having the same issue.

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

Are you using the same version? Can you explain your problems, maybe in a new thread?

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
People's Champ ,
Apr 06, 2018 Apr 06, 2018

There are several reasons for a pause that Captivate keeps track of behind the scenes. I believe there are at least 10 of them.

Depending on how the slide is paused, it's very hard to get it started again. If don't select continue playing project you can definitely get stuck.

I had a post at one time about using the REASON_FOR_PAUSE to get the project to play again. I'll see if I can find it somewhere.

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

No according to the Captivate Reference materials, these commands should work but having tried to work with it for a while with no success and little documentation from Adobe - Well interpret that as you will!

getVariableValueReturns the value of the given variable name.-window.cpAPIInterface.
getVariableValue
("cpQuizInfoStudentID");
setVariableValueSets the value of the given variable name with the given value.variableName:Stringwindow.cpAPIInterface.
setVariableValue
("cpQuizInfoStudentID",
"John");
playPlays the movie. window.cpAPIInterface.
play();
pausePauses the movie. window.cpAPIInterface.
pause();
stopStops the movie. window.cpAPIInterface.
stop();
rewindRewinds and plays the movie. window.cpAPIInterface.
rewind();
nextSeeks the movie to the next slide. window.cpAPIInterface.
next();
previousSeeks the movie to the previous slide. window.cpAPIInterface.
previous();
fastForwardIncreases the movie speed to 2x, then 4x and then back to normal on consecutive calls. window.cpAPIInterface.
fastForward();
getPlaySpeedReturns the movie playback speed in Frames per second (fps). window.cpAPIInterface.
getPlaySpeed();
getDurationInFramesReturns the total number of frames in the movie. window.cpAPIInterface.
getDurationInFrames();
getDurationInSecondsReturns the total duration of the movie in seconds. window.cpAPIInterface.
getDurationInSeconds();
getVolumeReturns the volume of the movie in percentage. window.cpAPIInterface.
getVolume();
setVolumeSets the volume of the movie.volume:Number (range : 0 - 1)window.cpAPIInterface.
setVolume(0.7);
navigateToTimeSeeks to a particular time (milliseconds) in the movie.timeInMilliseconds:Numberwindow.cpAPIInterface.
navigateToTime(3000);
canNavigateToTimeReturns a boolean value showing whether you can seek to a particular time in the movie or not.timeInMilliseconds:Numberwindow.cpAPIInterface.
canNavigateToTime(3000);
getCurrentFrameReturns the current frame of the movie. window.cpAPIInterface.
getCurrentFrame();
getCurrentSlideIndexReturns the current slide index of the movie. window.cpAPIInterface.
getCurrentSlideIndex();
getEventEmitterReturns the handle to the cpAPIEventEmitter object. window.cpAPIInterface.
getEventEmitter();
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
LEGEND ,
Apr 06, 2018 Apr 06, 2018

I have used some of those commands with success. Which ones did you try?

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

This thread answered my question.

Make Captivate play again after pausing - with Javascript

Which basically restates what the OP says, that the "Continue Playing Project" check box has to be checked. And when its checked, you don't need any script to play the movie, Captivate will do that for you.

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