public void enablePlayBack(boolean playBackEnabled, Long idleTime, Long incrementInMilliseconds) {
        this.siddhiAppContext.setPlayback(playBackEnabled);
        if (!playBackEnabled) {
            for (Scheduler scheduler : siddhiAppContext.getSchedulerList()) {
                scheduler.switchToLiveMode();
            }
        } else {
            if (idleTime != null && incrementInMilliseconds != null) {
                //Only use if both values are present. Else defaults will be used which got assigned when creating
                // the siddhi app runtimes if app contained playback information
                this.siddhiAppContext.getTimestampGenerator().setIdleTime(idleTime);
                this.siddhiAppContext.getTimestampGenerator().setIncrementInMilliseconds(incrementInMilliseconds);
            }

            for (Scheduler scheduler : siddhiAppContext.getSchedulerList()) {
                scheduler.switchToPlayBackMode();
            }
        }
    }
To enable and disable Siddhi App playback mode on runtime along with optional parameters.

@param playBackEnabled         whether playback is enabled or not
@param idleTime
@param incrementInMilliseconds
modules/siddhi-core/src/main/java/io/siddhi/core/SiddhiAppRuntimeImpl.java