reset

fun reset(): Boolean

Resets the media player to its uninitialized state.

This method performs the following actions sequentially:

  1. Clears the current data source

  2. Releases resources associated with the current playback

  3. Brings the player back to the idle state

After resetting, you must:

Typical use cases:

  • Switching between different video sources

  • Recovering from playback errors

  • Releasing resources before reusing the player instance

Example usage:

player.reset() // Reset existing configuration
player.setDataSource("new_video.mp4") // Set new source
player.prepare() // Prepare for playback
player.play() // Start playback

Note:

  • Do NOT call this method within any CypressMediaPlayerCallback methods (e.g. onPrepared, onCompleted). This may cause deadlocks or unexpected state conflicts.

Return

true if the reset operation succeeded, false otherwise. A return value of false typically indicates: - The player is in an invalid state (already closed). - Internal resource release failed.

See also

For setting new data sources after reset

For asynchronous preparation

Throws

IllegalStateException

if called on an invalid player instance. Always check valid before invocation.