Pause/continue the autoplay

The first thing you need to make the autoplay stop or continue is the ID of your slider.

in my example it's 10, so this the code, which would stop it's autoplay:

n2('#n2-ss-10').trigger('mediaStarted', 'lightbox');

and this is, which would make it continue:

n2('#n2-ss-10').trigger('mediaEnded', 'lightbox');

The 'lightbox' word can be anything, but it has to be unique. This is the identifier of the trigger in our code.

Example:
<div onclick="customAutoplay();">Click to stop or continue the autoplay</div>
<script>
var autoplayCounter = 0;
function customAutoplay(){
   if(autoplayCounter%2==0){
       n2('#n2-ss-10').trigger('mediaStarted', 'lightbox');
   } else {
       n2('#n2-ss-10').trigger('mediaEnded', 'lightbox');
   }
   autoplayCounter++;
}
</script>

You have to make sure, that the Media started and Media ended options are turned on at your autoplay's settings!

If you have the Autostart turned off, that has a higher priority, so the media start can't start the autoplay. In this case from version 3.0.38. use this code:

<div onclick="customAutoplay();">Click to stop or continue the autoplay</div>
<script>
var autoplayCounter = 0;
function customAutoplay(){
   if(autoplayCounter%2==0){
       window['n2-ss-10'].startAutoplay();
       n2('#n2-ss-10').trigger('mediaEnded', 'lightbox');       
   } else {
       n2('#n2-ss-10').trigger('mediaStarted', 'lightbox');       
   }
   autoplayCounter++;
}
</script>