Skip to main content
Known Participant
October 11, 2016
Question

Getting JS error with custom forward button..

  • October 11, 2016
  • 1 reply
  • 222 views

Hello,

I am using the following code with my forward and backward buttons to jump to slides that I have tagged with $bookmark$ in their title/label.  I have put the forward and backward buttons on my master and they just call the right JS function when clicked.  It is pretty much just copied and slightly adapted @TLCMediaDesign code. Thank you!

function jumpToNextBookmark() {

var getSlides = cp.model.data.project_main.slides.split( ',' );

var currentSlide = window.cpAPIInterface.getVariableValue('cpInfoCurrentSlide');

for ( var i = currentSlide; i < getSlides.length; i++ ) {

if (cp.model.data[ getSlides[ i ] ].lb.match(/\$bookmark\$/)!==null ) {   

window.cpAPIInterface.setVariableValue( 'cpCmndGotoSlide', i );    break;   }

}

}

function jumpToPrevBookmark() {

var getSlides = cp.model.data.project_main.slides.split( ',' );

var currentSlide = window.cpAPIInterface.getVariableValue('cpInfoCurrentSlide');

for ( var i = currentSlide-2; i >=0; i-- ) {  

if (cp.model.data[ getSlides[ i ] ].lb.match(/\$bookmark\$/)!==null )   {   

window.cpAPIInterface.setVariableValue( 'cpCmndGotoSlide', i );      break;   }

}

}

Everything works fine, but occasionally I get the following JS error in my console, and I am worried that someday it could be a problem.

INDEX~1.HTM:1 Uncaught (in promise) DOMException: The play() request was interrupted by a call to pause().

Any advice on what I can do about this?

This topic has been closed for replies.

1 reply

TLCMediaDesign
Inspiring
October 11, 2016

It's an issue with Chrome and doesn't affect functionality.