AstroPlayer
The main class for controlling media playback.
AstroPlayer provides a set of methods for playing, pausing, seeking, and managing media items in a playlist.
Parameters
An implementation of the underlying native media player that AstroPlayer delegates playback functionality to. The specific type of NativeMediaPLayer will vary depending on the platform and the AstroPlayer implementation.
The main class for controlling media playback.
AstroPlayer provides a set of methods for playing, pausing, seeking, and managing media items in a playlist.
Parameters
An implementation of the underlying native media player that AstroPlayer delegates playback functionality to. The specific type of NativeMediaPLayer will vary depending on the platform and the AstroPlayer implementation.
Types
Properties
Gets the duration of the current media item in milliseconds.
Gets the duration of the current media item in milliseconds.
Gets the current equalizer values, or null if the equalizer is not enabled or not supported.
Gets the current equalizer values, or null if the equalizer is not enabled or not supported.
Gets the currently playing media item, or null if no media item is playing.
Gets the currently playing media item, or null if no media item is playing.
Gets the index of the currently playing media item in the playlist, or -1 if no media item is playing.
Gets the index of the currently playing media item in the playlist, or -1 if no media item is playing.
The metadata associated with the currently playing media item, or null if no item is playing or the item has no metadata.
Gets the current playback position in milliseconds.
Gets the current playback position in milliseconds.
Indicates whether there's a next media item available in the playlist after the current one.
Indicates whether there's a previous media item available in the playlist before the current one.
Gets or sets whether the equalizer is enabled.
Gets or sets whether the equalizer is enabled.
Gets or sets whether smart equalizer is enabled. When enabled, the player will attempt to apply an equalizer configuration based on the current media item's equalizer ID and the following logic:
Gets or sets whether smart equalizer is enabled. When enabled, the player will attempt to apply an equalizer configuration based on the current media item's equalizer ID and the following logic:
Gets the total number of media items in the playlist.
Gets the total number of media items in the playlist.
Gets or sets the playback speed. Values greater than 1.0 indicate faster playback, while values less than 1.0 indicate slower playback.
Gets or sets the playback speed. Values greater than 1.0 indicate faster playback, while values less than 1.0 indicate slower playback.
The current repeat mode of the player.
The current repeat mode of the player.
The default seek backward increment in milliseconds.
The default seek backward increment in milliseconds.
The default seek forward increment in milliseconds.
The default seek forward increment in milliseconds.
Indicates whether shuffle mode is enabled.
Indicates whether shuffle mode is enabled.
An optional callback function that allows you to provide custom equalizer values for specific equalizer preset IDs. This property is used for smart equalizers, where the player can dynamically adjust the sound based on the selected preset.
An optional callback function that allows you to provide custom equalizer values for specific equalizer preset IDs. This property is used for smart equalizers, where the player can dynamically adjust the sound based on the selected preset.
Functions
Registers a listener to receive notifications about playback and media state changes in AstroPlayer.
Adds a media item to the playlist.
Inserts a media item at a specific index in the playlist.
Adds a media item to the playlist.
Inserts a media item at a specific index in the playlist.
Adds a list of media items to the end of the playlist.
Inserts a list of media items at a specific index in the playlist.
Adds a list of media items to the end of the playlist.
Inserts a list of media items at a specific index in the playlist.
Returns a list containing all media items in the playlist.
Returns a list containing all media items in the playlist.
Removes all media items from the playlist.
Removes all media items from the playlist.
Clears the current playlist and then adds a single media item.
Clears the current playlist and then adds a single media item at a specific index.
Clears the current playlist and then adds a collection of media items.
Clears the current playlist and then adds a collection of media items at a specific index.
Decreases the player volume.
Decreases the player volume.
Decreases the player volume by a specified offset.
Decreases the player volume by a specified offset.
Increases the player volume.
Increases the player volume.
Increases the player volume by a specified offset.
Increases the player volume by a specified offset.
Applies a transformation function to each media item in the playlist and returns a list of the transformed results.
Applies a transformation function to each media item in the playlist and returns a list of the transformed results.
Moves a media item from one index to another in the playlist.
Moves a media item from one index to another in the playlist.
Moves a range of media items from one index to another in the playlist.
Moves a range of media items from one index to another in the playlist.
Unregisters a previously registered listener from receiving notifications from AstroPlayer.
Removes a media item from the playlist by its index.
Removes a media item from the playlist by its index.
Removes a range of media items from the playlist.
Removes a range of media items from the playlist.
Replaces a media item at a specific index in the playlist.
Replaces a media item at a specific index in the playlist.
Replaces a range of media items in the playlist with a new list of media items.
Replaces a range of media items in the playlist with a new list of media items.
Seeks the playback position backward by the specified number of milliseconds.
Seeks the playback position backward by the default seek backward increment.
Seeks the playback position forward by the specified number of milliseconds.
Seeks the playback position forward by the default seek forward increment.
Seeks the playback position to the end of the current media item.
Selects a media item from the playlist by its index.
Selects a media item from the playlist by its index.
Seeks to a specific media item and then sets the playback position within that item.
Seeks to the next media item in the playlist, if available.
Seeks to the previous media item in the playlist, if available.
Seeks the playback position to the beginning of the current media item.