Jumping Back 10 Seconds On a Slide (AP9)

Hello all :slight_smile:
I am adding a YouTube video to a lesson and have removed player controls and all slide navigation (i.e., the user is forced to watch the entire video). That said, I would like to add some buttons to the screen:

  • Restart (no problem :wink:!)
  • Pause (not problem :wink:!)
  • Jump back 10 seconds (problem :cry:)

I am not sure how or if this can be done. I saw some older threads with some script in them but I’m not sure if they still work (as they were written for older versions of AP) and I’m not as familiar with scripting as I should be so I need to know exactly what to put to jump back exactly 10 seconds (or whatever if the user were less than 10 seconds into the video).

Any suggestions out there? TIA!


Hmm… There are some controls for manipulation of the timeline but if your YouTube video runs independent of the timeline - I would not expect them to work.

Nonetheless, you could try them and see.

On a given slide - you can adjust the system variable apCurrentSlideProgress
This value is in milliseconds so if you wish to go back 10 seconds - you would use the value of 10000.

You might try creating an onClick event for a button and choose adjust variable.
Then you could do a subtract 10000

Note that setting this variable does not change the state of the video.
If you go back while the slide is still playing - the slide will keep going.
If you go back after the slide has stopped - you’ll go back 10 seconds but be in a paused state.


For a YouTube video that runs independently, you can try the code found in this thread and adjust the values as needed for your project.

1 Like

Thanks so much for your quick reply @gregs :heart_eyes: - your first suggestion works perfectly! I understand what you are saying that if the video has already done, the user will not be able to jump back 10 seconds. Rather they can, but the video will be paused. Currently I have the slide set so that when the YouTube video finishes, it will automatically go to another slide, so hopefully no one will need to review the last ten seconds.

I did see the other thread you mentioned, but as I said in my original post, I’m not so familiar yet with the scripting so I would need the exact code (including where to put the 10 or 10000) to make it work, lol.

Do you think using the code would alleviate the risk of users going back to a static video if they’ve tried to reply the last ten seconds of the video (i.e. if the slide has already stopped)?

Thanks again!

Using the code begins the same way with adding an onClick event.
You will just choose to Execute JavaScript.

The code will be entered in the script window.

The thread gives an example of 5 seconds so it appears you could simply change all the 5 values to 10 but if the other approach is working.

As for going back after the slide has paused - I would just add an extra command to play after going back.

1 Like

Thanks again @gregs - I really appreciate it!

I know how to use the Execute JavaScript function - I have a few in my project already. The problem is I don’t understand which code to use from that thread. There’s a lot on there and stuff I don’t quite understand with YouTube APIs and player, etc.

Thanks again!