GadulkaPlayer

actual class GadulkaPlayer
expect class GadulkaPlayer

A minimalistic audio player

Example:

val player = GadulkaPlayer()
player.play(url = "...")
player.stop()
player.release()
actual class GadulkaPlayer
actual class GadulkaPlayer
actual class GadulkaPlayer

Constructors

Link copied to clipboard
actual constructor()
expect constructor()
actual constructor()
actual constructor()
actual constructor()

Properties

Link copied to clipboard
var playerState: MediaPlayer?

Functions

Link copied to clipboard
actual fun currentDuration(): Long?
expect fun currentDuration(): Long?

Retrieves the total duration of the playback item in milliseconds.

actual fun currentDuration(): Long?
actual fun currentDuration(): Long?
actual fun currentDuration(): Long?
Link copied to clipboard

Retrieves the current state of the player

actual fun currentPlayerState(): GadulkaPlayerState?
Link copied to clipboard
actual fun currentPosition(): Long?
expect fun currentPosition(): Long?

Retrieves the current playback position in milliseconds.

actual fun currentPosition(): Long?
actual fun currentPosition(): Long?
actual fun currentPosition(): Long?
Link copied to clipboard
actual fun currentVolume(): Float?
expect fun currentVolume(): Float?

Retrieves the current volume level of the player.

actual fun currentVolume(): Float?
actual fun currentVolume(): Float?
actual fun currentVolume(): Float?
Link copied to clipboard

Checks whether the player is currently in a playing or buffering state.

Link copied to clipboard
actual fun pause()
expect fun pause()

Pauses the audio playback without resetting the play position. To resume playback, call play.

actual fun pause()
actual fun pause()
actual fun pause()
Link copied to clipboard
actual fun play()
actual fun play(url: String)
fun play(rawResourceId: Int)

Android-specific implementation of the play method which uses a ContentResolver to calculate the Uri of a raw file resource bundled with the app.

expect fun play()

Resumes audio playback from the current position if it was previously paused.

expect fun play(url: String)

Start playback of the audio resource at the provided url.

actual fun play()
actual fun play(url: String)
actual fun play()
actual fun play(url: String)
actual fun play()
actual fun play(url: String)
Link copied to clipboard
actual fun release()
expect fun release()

Pause and attempts to perform cleanup in order to dispose of any player resources.

actual fun release()
actual fun release()
actual fun release()

Stops playback and removes the player element from the DOM.

Link copied to clipboard
actual fun seekTo(time: Long)
expect fun seekTo(time: Long)

Seeks to the specified playback position in the currently playing media.

actual fun seekTo(time: Long)
actual fun seekTo(time: Long)
actual fun seekTo(time: Long)
Link copied to clipboard
actual fun setRate(rate: Float)
expect fun setRate(rate: Float)

Adjusts the playback speed of the audio.

actual fun setRate(rate: Float)
actual fun setRate(rate: Float)
actual fun setRate(rate: Float)
Link copied to clipboard
actual fun setVolume(volume: Float)
expect fun setVolume(volume: Float)

Adjusts the volume level of the player.

actual fun setVolume(volume: Float)
actual fun setVolume(volume: Float)
actual fun setVolume(volume: Float)
Link copied to clipboard
actual fun stop()
expect fun stop()

Stop playback and return the play position to the beginning of time (position 0).

actual fun stop()
actual fun stop()
actual fun stop()