var callback = arguments[arguments.length - 1];
  var startTime = parseInt(Date.now()/1000 );
  function check_fps() {
  var currPlaybackrate = [];
  var currFps = 0;
  var lowerLimit = #{fps} - 2
  var upperLimit = #{fps} + 2
  while (parseInt(Date.now()/1000) < (startTime + #{playback_duration})){
    currPlaybackrate = player.getPlaybackRate();
    currFps = currPlaybackrate['fps'];
    setTimeout(function(){
      if (currFps > upperLimit || currFps < lowerLimit){
        callback({
          'success': false,
          'message': 'Expected FPS within lowerLimit-upperLimit. Got FPS - ' + currFps
        });
      }
    }, 2000);
  }
  callback({'success': true, 'message': ''});
}
check_fps();