fsplayer.api.PlaybackController Class

The PlaybackController class exposes the following constants and methods:

Table 1. Constants
Constant Type Value Description
PAUSE_PLAYBACK String playbackListener_onPausePlayback Defines the name of pause playback event.
START_PLAYBACK String playbackListener_onStartPlayback Defines the name of start playback event.
ANIMATION_STEP_CHANGED String playbackListener_onAnimationStepChanged Defines the name of animation step changed event.
SLIDE_POSITION_CHANGED String playbackListener_onSlidePositionChanged Defines the name of slide position changed event.
CURRENT_SLIDE_INDEX_CHANGED String playbackListener_onCurrentSlideIndexChanged Defines the name of current slide is changed event.
SLIDE_LOADING_COMPLETE String playbackListener_onSlideLoadingComplete Defines the name of slide loading is completed event.
PRESENTATION_PLAYBACK_COMPLETE String playbackListener_onPresentationPlaybackComplete Defines the name of presentation playback completed event.
PLAYBACK_SUSPENDED String playbackListener_onPlaybackSuspended Defines the name of presentation playback suspended event.
PLAYBACK_RESUMED String playbackListener_onPlaybackResumed Defines the name of presentation playback resumed event.
Table 2. Methods
Method Description
play() Starts or resumes presentation playback.
pause() Suspends presentation playback.
gotoSlide(slideIndex, autoStart) Switches to the given slide of the presentation and starts its playback Notes: Slide index is zero-based.
isPlaying(slideIndex, autoStart) Indicates whether the presentation is playing or not.
gotoNextSlide(autoStart) Switches to the next presentation slide and starts its playback. Note: if the autoStart parameter was set to false, slide playback would not be started after switching.
gotoPreviousSlide(autoStart) Switches to the previous presentation slide and starts its playback. Note: if the autoStart parameter was set to false, slide playback would not be started after switching.
getCurrentSlideIndex() Returns current slide index.
getCurrentSlidePlaybackPosition() Returns playback position within current slide. Note: playback position is a number between 0 and 1.
gotoNextStep() Plays current slide from the beginning of the next animation step. Note: being called at the end of the slide this method plays presentation from the beginning of the next slide.
gotoPreviousStep() Moves slide playback one step back. This method suspends slide playback at the end of the previous animation step. Note: being called on the start slide step this method causes playback switching to the end of the previous slide.
getCurrentStepIndex() Returns current animation step index.
setPausePlaybackHandler() Sets onPausePlayback() method as handler for PAUSE_PLAYBACK event.
onPausePlayback() Does nothing. This method can be overridden.
setStartPlaybackHandler() Sets onStartPlayback() method as handler for START_PLAYBACK event.
onStartPlayback() Does nothing. This method can be overridden.
setAnimationStepChangedHandler() Sets onAnimationStepChanged() method as handler for ANIMATION_STEP_CHANGED event.
onAnimationStepChanged(stepIndex) Does nothing. This method can be overridden.
setSlidePositionChangedHandler() Set onSlidePositionChanged() method as a handler of SLIDE_POSITION_CHANGED event.
onSlidePositionChanged(position) Does nothing. This method can be overridden.
setCurrentSlideIndexChangedHandler() Sets onCurrentSlideIndexChanged() method as a handler of CURRENT_SLIDE_INDEX_CHANGED event.
onCurrentSlideIndexChanged(slideIndex) Does nothing. This method can be overridden.
setSlideLoadingCompleteHandler() Sets onSlideLoadingComplete() method as a handler of SLIDE_LOADING_COMPLETE event.
onSlideLoadingComplete(slideIndex) Does nothing. This method can be overridden.
setPresentationPlaybackCompleteHandler() Sets onPresentationPlaybackComplete() method as a handler of PRESENTATION_PLAYBACK_COMPLETE event.
onPresentationPlaybackComplete() Does nothing. This method can be overridden.
setPlaybackSuspendedHandler() Sets onPlaybackSuspended() method as a handler of the PLAYBACK_SUSPENDED event.
setPlaybackResumedHandler() Sets onPlaybackResumed() method as a handler of the PLAYBACK_RESUMED event.
enableAllEventHandlers() Enable all event handlers.
removeAllEventHandlers() Removes all event handlers.
setPlaybackHandler(event) Set playback handler for specified event. The possible event parameter values are: fsplayer.api.PlaybackController.PAUSE_PLAYBACK, fsplayer.api.PlaybackController.START_PLAYBACK, fsplayer.api.PlaybackController.ANIMATION_STEP_CHANGED, fsplayer.api.PlaybackController.SLIDE_POSITION_CHANGED, fsplayer.api.PlaybackController.CURRENT_SLIDE_INDEX_CHANGED, fsplayer.api.PlaybackController.SLIDE_LOADING_COMPLETE, fsplayer.api.PlaybackController.PRESENTATION_PLAYBACK_COMPLETE, fsplayer.api.PlaybackController.PLAYBACK_SUSPENDED, fsplayer.api.PlaybackController.PLAYBACK_RESUMED.
removePlaybackHandler(event) Set playback handler for specified event. The possible event parameter values are: fsplayer.api.PlaybackController.PAUSE_PLAYBACK, fsplayer.api.PlaybackController.START_PLAYBACK, fsplayer.api.PlaybackController.ANIMATION_STEP_CHANGED, fsplayer.api.PlaybackController.SLIDE_POSITION_CHANGED, fsplayer.api.PlaybackController.CURRENT_SLIDE_INDEX_CHANGED, fsplayer.api.PlaybackController.SLIDE_LOADING_COMPLETE, fsplayer.api.PlaybackController.PRESENTATION_PLAYBACK_COMPLETE, fsplayer.api.PlaybackController.PLAYBACK_SUSPENDED, fsplayer.api.PlaybackController.PLAYBACK_RESUMED.