Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
Did you ever get this working? I am having the same issue.
Thanks!
Copy link to clipboard
Copied
Are you using the same version? Can you explain your problems, maybe in a new thread?
Copy link to clipboard
Copied
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.
Copy link to clipboard
Copied
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!
| getVariableValue | Returns the value of the given variable name. | - | window.cpAPIInterface. getVariableValue ("cpQuizInfoStudentID"); |
| setVariableValue | Sets the value of the given variable name with the given value. | variableName:String | window.cpAPIInterface. setVariableValue ("cpQuizInfoStudentID", "John"); |
| play | Plays the movie. | window.cpAPIInterface. play(); | |
| pause | Pauses the movie. | window.cpAPIInterface. pause(); | |
| stop | Stops the movie. | window.cpAPIInterface. stop(); | |
| rewind | Rewinds and plays the movie. | window.cpAPIInterface. rewind(); | |
| next | Seeks the movie to the next slide. | window.cpAPIInterface. next(); | |
| previous | Seeks the movie to the previous slide. | window.cpAPIInterface. previous(); | |
| fastForward | Increases the movie speed to 2x, then 4x and then back to normal on consecutive calls. | window.cpAPIInterface. fastForward(); | |
| getPlaySpeed | Returns the movie playback speed in Frames per second (fps). | window.cpAPIInterface. getPlaySpeed(); | |
| getDurationInFrames | Returns the total number of frames in the movie. | window.cpAPIInterface. getDurationInFrames(); | |
| getDurationInSeconds | Returns the total duration of the movie in seconds. | window.cpAPIInterface. getDurationInSeconds(); | |
| getVolume | Returns the volume of the movie in percentage. | window.cpAPIInterface. getVolume(); | |
| setVolume | Sets the volume of the movie. | volume:Number (range : 0 - 1) | window.cpAPIInterface. setVolume(0.7); |
| navigateToTime | Seeks to a particular time (milliseconds) in the movie. | timeInMilliseconds:Number | window.cpAPIInterface. navigateToTime(3000); |
| canNavigateToTime | Returns a boolean value showing whether you can seek to a particular time in the movie or not. | timeInMilliseconds:Number | window.cpAPIInterface. canNavigateToTime(3000); |
| getCurrentFrame | Returns the current frame of the movie. | window.cpAPIInterface. getCurrentFrame(); | |
| getCurrentSlideIndex | Returns the current slide index of the movie. | window.cpAPIInterface. getCurrentSlideIndex(); | |
| getEventEmitter | Returns the handle to the cpAPIEventEmitter object. | window.cpAPIInterface. getEventEmitter(); |
Copy link to clipboard
Copied
I have used some of those commands with success. Which ones did you try?
Copy link to clipboard
Copied
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.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more