The Flowplayer interface is the core entry point to the Android SDK and integrated API. It provides definitions for the core listeners and main methods to control and manage media playback from the player.
The StateListener interface fires when the internal state of the player changes. It accepts parameters for the
currentState of the player. We support the different player states listed in the following table.
|The player can't play from its current position. Typically occurs when more data needs to be loaded.
|The player has finished playing the media.
|The player doesn't have any media to play because the
stop() method was invoked.
|The player doesn't have any media to play.
|The player can immediately play from its current position. It will start or resume playback when the
play() method is called.
|The player is currently playing.
See the State reference documentation for additional details.
The Android SDK provides several functions and methods to interact with the player, to perform specific actions, and to change the player's behavior. Each method is listed in the following table. For a full reference and additional details about parameters and default settings, see the Flowplayer Functions reference documentation.
|Adds an event listener.
|Returns the player's current position (in seconds).
|Returns the current media's duration (in seconds).
|Returns the player's current playback state.
true (default) if the player is set to use the built-in controls. Otherwise,
|Tells the player whether or not it should hide the build-in controls.
true if the player is currently in full-screen mode. Otherwise,
|Tells the player to mute or unmute.
|Handles changes in the host activity's or fragment's Picture-in-Picture (PiP) mode.
|Tells the player to pause the playback. If the player is not ready, then the playback remains paused after the player is prepared.
|Tells the player to start the playback. If the player is not ready, then the playback starts as soon the player is prepared.
|Prepares the player with an
autoStart set by default to
|If the player was previously prepared but the playback stopped unexpectedly, call this method to prepare the player again with the previously specified video.
|Removes a previously added event listener.
|Tells the player to seek to a new position.
|Sets a new audio track.
|Sets optional control configurations. Build the configuration using the
|Toggles the player's full-screen state.
The result is also affected by whether setFullscreenControlOrientation is set to
true (default). If
setFullscreenControlOrientation is set to
setFullscreen is called, then the device's orientation automatically rotates to landscape when the player enters full-screen mode and to portait when the player exits full-screen mode.
|Tells the player whether or not toggling the full-screen state should also change the device's orientation.
|Sets a custom
FullscreenManager interface to dictate how full-screen mode should handled.
|Sets the android.app.PendingIntent to be triggered when the user taps on the media notification.
|Sets the androidx.media3.ui.AspectRatioFrameLayout.ResizeMode.
|Sets the behavior of the video player when the host activity is paused.
|Sets a new playback speed.
|Sets a new subtitle track.
|Tells the player whether or not it should use the built-in controls.
|Sets a new video track.
|Adjusts the player's volume.
|Tells the player to stop the playback. This resets the player. To start playback again, the player needs to be prepared again.