Skip to content

Latest commit

 

History

History
1008 lines (648 loc) · 73.7 KB

API.md

File metadata and controls

1008 lines (648 loc) · 73.7 KB

API reference

Generated from the TypeScript definitions with @capacitor/docgen (npm run docgen). Do not edit between the docgen markers.

Most apps use the Playlist object shown here. The Cordova-style RmxAudioPlayer wrapper is described in usage.md.

addListener('status', ...)

addListener(eventName: 'status', listenerFunc: PlaylistStatusChangeCallback) => Promise<PluginListenerHandle>

Subscribe to native playback status events (track changes, position, errors, etc.).

Param Type Description
eventName 'status' Must be 'status'.
listenerFunc PlaylistStatusChangeCallback Callback receiving { action, status } where status.msgType is a RmxAudioStatusMessage.

Returns: Promise<PluginListenerHandle>


addListener('download', ...)

addListener(eventName: 'download', listenerFunc: (event: DownloadEvent) => void) => Promise<PluginListenerHandle>

Subscribe to offline download progress (Android and iOS).

Param Type Description
eventName 'download' Must be 'download'.
listenerFunc (event: DownloadEvent) => void Callback receiving { downloadId, state, progress, error? }.

Returns: Promise<PluginListenerHandle>


setOptions(...)

setOptions(options: AudioPlayerOptions) => Promise<void>

Configure plugin behaviour (verbose logging, stream pause handling, notification icon). Can be called at any time; not required before playback.

Param Type
options AudioPlayerOptions

initialize()

initialize() => Promise<void>

Initialise the native player, register status callbacks, and arm lock-screen / notification controls. Call once before playback (e.g. on app start).


release()

release() => Promise<void>

Tear down native resources (audio session, media service, observers). Call when the app no longer needs background audio (e.g. on logout).


setPlaylistItems(...)

setPlaylistItems(options: PlaylistOptions) => Promise<void>

Replace the entire playlist. Clears all previous items. Use options.retainPosition to keep the current track and playback position.

Optional drm on items is additive: Android attaches Widevine through a host-registered provider (AudioDrm.setProvider). iOS uses the host FairPlay AudioDrm provider. Without a provider the call is rejected with code noProvider and the previous queue is left unchanged. Web rejects with code notSupported. DRM playback errors use the existing status listener (RMXSTATUS_ERROR) with value.error set to one of blockedByStreamLimit | notEntitled | expired | network | unknown.

Param Type
options PlaylistOptions

addItem(...)

addItem(options: AddItemOptions) => Promise<void>

Append a single track to the end of the playlist, or insert at a 0-based index. When index is omitted the track is appended. Insertion does not interrupt playback of the current track.

Items with drm follow the same provider / noProvider rules as setPlaylistItems.

Param Type
options AddItemOptions

moveItem(...)

moveItem(options: MoveItemOptions) => Promise<void>

Move a track from one index to another without restarting the current track.

Param Type
options MoveItemOptions

replaceItem(...)

replaceItem(options: ReplaceItemOptions) => Promise<void>

Replace a track's metadata and source URL in place (e.g. stream URL → local file). When replacing the currently playing track, playback position and play/pause state are preserved.

Items with drm follow the same provider / noProvider rules as setPlaylistItems.

Param Type
options ReplaceItemOptions

addAllItems(...)

addAllItems(options: AddAllItemOptions) => Promise<void>

Append multiple tracks to the end of the playlist. Raises one RMXSTATUS_ITEM_ADDED event per track.

If any item has drm and cannot open, the whole call fails and the previous queue is left unchanged (same provider / noProvider rules as setPlaylistItems).

Param Type
options AddAllItemOptions

removeItem(...)

removeItem(options: RemoveItemOptions) => Promise<void>

Remove a track by index (preferred) or id. If the removed track is currently playing, the next track starts automatically.

Param Type
options RemoveItemOptions

removeItems(...)

removeItems(options: RemoveItemsOptions) => Promise<void>

Remove multiple tracks in a single batch. If the currently playing track is removed, the next available track starts automatically.

Param Type
options RemoveItemsOptions

clearAllItems()

clearAllItems() => Promise<void>

Remove all tracks from the playlist. Raises RMXSTATUS_PLAYLIST_CLEARED and RMXSTATUS_STOPPED.


getPlaylist()

getPlaylist() => Promise<GetPlaylistResult>

Return a snapshot of the current playlist items.

Returns: Promise<GetPlaylistResult>


play()

play() => Promise<void>

Start or resume playback of the current track. No-op if the playlist is empty.


pause()

pause() => Promise<void>

Pause playback of the current track.


skipForward()

skipForward() => Promise<void>

Skip to the next track. At the end of the playlist, wraps to the beginning when loop is enabled.


skipBack()

skipBack() => Promise<void>

Skip to the previous track. No-op when already at the first track.


seekTo(...)

seekTo(options: SeekToOptions) => Promise<void>

Seek to a position (seconds) in the currently playing track. If the position exceeds track length, playback advances to the next track.

Param Type
options SeekToOptions

playTrackByIndex(...)

playTrackByIndex(options: PlayByIndexOptions) => Promise<void>

Jump to the track at the given 0-based index and start playback.

Param Type
options PlayByIndexOptions

playTrackById(...)

playTrackById(options: PlayByIdOptions) => Promise<void>

Jump to the track with the given id and start playback.

Param Type
options PlayByIdOptions

selectTrackByIndex(...)

selectTrackByIndex(options: SelectByIndexOptions) => Promise<void>

Select the track at the given index without necessarily starting playback.

Param Type
options SelectByIndexOptions

selectTrackById(...)

selectTrackById(options: SelectByIdOptions) => Promise<void>

Select the track with the given id without necessarily starting playback.

Param Type
options SelectByIdOptions

setPlaybackVolume(...)

setPlaybackVolume(options: SetPlaybackVolumeOptions) => Promise<void>

Set media stream volume. Float in range [0, 1]. Hardware volume controls still apply on top of this value.

Param Type
options SetPlaybackVolumeOptions

setLoop(...)

setLoop(options: SetLoopOptions) => Promise<void>

When true, the playlist loops back to the first track after the last track completes.

Param Type
options SetLoopOptions

setPlaybackRate(...)

setPlaybackRate(options: SetPlaybackRateOptions) => Promise<void>

Set playback speed. Float value; 0 pauses, 1 is normal speed.

Param Type
options SetPlaybackRateOptions

prepareForVideoHandoff()

prepareForVideoHandoff() => Promise<void>

Release native audio session / focus so a video player can own playback.

Android: pauses current track, abandons audio focus, stores head position. Does not stop the foreground media service. iOS: pauses, captures head position, deactivates AVAudioSession with notifyOthersOnDeactivation. Web: pauses HTMLAudioElement and stores currentTime.

Call immediately before native video starts (e.g. your video plugin's init method).


resumeAfterVideoHandoff(...)

resumeAfterVideoHandoff(options: ResumeAfterVideoHandoffOptions) => Promise<ResumeAfterVideoHandoffResult>

Re-arm native audio after video ends or, on Android, prewarm the media service before video starts.

Without prewarm (typical exit path):

  • Android: when play is true (default), re-acquires focus and resumes at position. When resumed is true, JS should skip redundant seekTo/play. When play is false, clears handoff retain and returns { resumed: false } so JS can seek without playing.
  • iOS: restores pinned track, reactivates AVAudioSession, seeks to position, and when play is true starts playback (seek-then-play). Returns { resumed: true } when native handled the handoff.
  • Web: stores position only (no native session); returns { resumed: false }.

With prewarm: true (Android, before video): retains MediaService FGS while the app is visible (Android 14+ while-in-use). Does not prepare or play the audio item — overlay video owns decrypt. Always returns { resumed: false }.

Param Type
options ResumeAfterVideoHandoffOptions

Returns: Promise<ResumeAfterVideoHandoffResult>


getLastKnownPosition()

getLastKnownPosition() => Promise<GetLastKnownPositionResult>

Return the audio head position (seconds) captured during the most recent prepareForVideoHandoff or passed to resumeAfterVideoHandoff.

Returns: Promise<GetLastKnownPositionResult>


startDownload(...)

startDownload(options: StartDownloadOptions) => Promise<{ downloadId: string; }>

Download an HLS lecture for offline playback (Android and iOS). Protected playlists pass drm; the host AudioOfflineProvider acquires the offline licence first, then media is fetched, so a refused licence (notEntitled, offlineDeviceLimit, ...) fetches no media. Unpackaged (clear) HLS omits drm and skips the licence. Progress and the outcome arrive on the download listener. Restarting a failed download with a fresh URL reuses cached segments on Android; on iOS the partial asset is discarded and a new task starts.

Rejects noProvider when no provider is registered, invalidArgument for missing fields. Web rejects notSupported.

Param Type
options StartDownloadOptions

Returns: Promise<{ downloadId: string; }>


cancelDownload(...)

cancelDownload(options: DownloadIdOptions) => Promise<void>

Cancel a non-completed download: removes cache/asset, index entry, metadata and licence. A no-op for completed downloads (use deleteDownload).

Param Type
options DownloadIdOptions

deleteDownload(...)

deleteDownload(options: DownloadIdOptions) => Promise<void>

Delete a download in any state: cache/asset, index entry, metadata and licence are removed. Failures releasing the licence are ignored.

Param Type
options DownloadIdOptions

renewDownload(...)

renewDownload(options: RenewDownloadOptions) => Promise<void>

Renew the offline licence while online. On success expiresAt is refreshed; a refusal rejects with the typed error and emits expired only when the provider state is expired.

Param Type
options RenewDownloadOptions

listDownloads()

listDownloads() => Promise<{ downloads: DownloadInfo[]; }>

All downloads with state, progress and estimated licence expiry.

Returns: Promise<{ downloads: DownloadInfo[]; }>


Interfaces

PluginListenerHandle

Prop Type
remove () => Promise<void>

PlaylistStatusChangeCallbackArg

Prop Type
action string
status OnStatusCallbackData

OnStatusCallbackData

Encapsulates the data received by an onStatus callback

Prop Type Description
trackId string The ID of this track. If the track is null or has completed, this value is "NONE" If the playlist is completed, this value is "INVALID"
msgType RmxAudioStatusMessage The type of status update
value OnStatusCallbackUpdateData | OnStatusTrackChangedData | OnStatusErrorCallbackData The status payload. For all updates except ERROR, the data package is described by OnStatusCallbackUpdateData. For Errors, the data is shaped as OnStatusErrorCallbackData

OnStatusCallbackUpdateData

Contains the current track status as of the moment an onStatus update event is emitted.

Prop Type Description
trackId string The ID of this track corresponding to this event. If the track is null or has completed, this value is "NONE". This will happen when skipping to the beginning or end of the playlist. If the playlist is completed, this value is "INVALID"
isStream boolean Boolean indicating whether this is a streaming track.
currentIndex number The current index of the track in the playlist.
status 'error' | 'unknown' | 'ready' | 'playing' | 'loading' | 'paused' The current status of the track, as a string. This is used to summarize the various event states that a track can be in; e.g. "playing" is true for any number of track statuses. The Javascript interface takes care of this for you; this field is here only for reference.
currentPosition number Current playback position of the reported track.
duration number The known duration of the reported track. For streams or malformed MP3's, this value will be 0.
playbackPercent number Progress of track playback, as a percent, in the range 0 - 100
bufferPercent number Buffering progress of the track, as a percent, in the range 0 - 100
bufferStart number The starting position of the buffering progress. For now, this is always reported as 0.
bufferEnd number The maximum position, in seconds, of the track buffer. For now, only the buffer with the maximum playback position is reported, even if there are other segments (due to seeking, for example). Practically speaking you don't need to worry about that, as in both implementations the minor gaps are automatically filled in by the underlying players.

OnStatusTrackChangedData

Reports information about the playlist state when a track changes. Includes the new track, its index, and the state of the playlist.

Prop Type Description
currentItem AudioTrack The new track that has been selected. May be null if you are at the end of the playlist, or the playlist has been emptied.
currentIndex number The 0-based index of the new track. If the playlist has ended or been cleared, this will be -1.
isAtEnd boolean Indicates whether the playlist is now currently at the last item in the list.
isAtBeginning boolean Indicates whether the playlist is now at the first item in the list
hasNext boolean Indicates if there are additional playlist items after the current item.
hasPrevious boolean Indicates if there are any items before this one in the playlist.

AudioTrack

An audio track for playback by the playlist.

Prop Type Description
isStream boolean This item is a streaming asset. Make sure this is set to true for stream URLs, otherwise you will get odd behavior when the asset is paused. This only affects pause/resume buffering behavior. It does not select how the source is parsed - use mimeType for that.
trackId string trackId is optional and if not passed in, an auto-generated UUID will be used.
assetUrl string URL of the asset; can be local, a URL, or a streaming URL. If the asset is a stream, make sure that isStream is set to true, otherwise the plugin can't properly handle the item's buffer.
mimeType string Optional container hint for sources whose URL carries no usable file extension, e.g. 'application/x-mpegURL' for an HLS playlist served from an extensionless URL. Leave this unset for ordinary progressive sources - Android sniffs the content and web reads the URL, both of which handle MP3/AAC/OGG streams without a hint. HLS is detected automatically when the URL path ends in .m3u8. No-op on iOS, where AVFoundation determines the type itself.
albumArt string The local or remote URL to an image asset to be shown for this track. If this is null, the plugin's default image is used.
artist string The track's artist
album string Album the track belongs to
title string Title of the track
startPosition number Last known playback position to resume from, in seconds, when this track becomes current via a native skip-to-next/previous (e.g. OS notification, headset button, Android Auto/CarPlay, or the in-app Next/Previous buttons). Optional; defaults to 0.
drm AudioTrackDrmOptions Optional DRM descriptor fields (API names). Android attaches Widevine, and iOS attaches FairPlay (Story 58.5), through a host-registered provider. Token URL, heartbeat URL, and Bearer live on that provider, not here. Web still refuses items that set this.
downloadId string Id of a completed offline download (see startDownload). The item plays from the local download (Android cache / iOS AVAssetDownload asset) with the host provider's offline licence; assetUrl is not used for playback. If the licence has expired, playback is refused with the expired error. Web refuses items that set this.

AudioTrackDrmOptions

Prop Type Description
widevineLicenseUrl string Consumed by Android via the host-registered drm-kit Widevine provider; ignored on iOS (FairPlay only — see fairplayLicenseUrl).
playbackSessionId string
renewalCredential string
streamLimit AudioTrackDrmStreamLimit
fairplayLicenseUrl string Consumed by iOS via the host-registered drm-kit FairPlay provider (Story 58.5); still ignored on Android (Widevine only).
fairplayCertificateUrl string Consumed by iOS via the host-registered drm-kit FairPlay provider (Story 58.5); still ignored on Android (Widevine only).
slug string Catalog asset slug for /drm-token; must match this session, not DrmHost's last audio slug.

AudioTrackDrmStreamLimit

Optional playlist-item DRM fields. Names match the playback API and video plugin. Token / heartbeat URLs and Bearer are supplied by the host provider (57.6).

Prop Type
mode string
renewalIntervalSeconds number
heartbeatIntervalSeconds number

OnStatusErrorCallbackData

Represents an error reported by the onStatus callback.

Prop Type Description
code RmxAudioErrorType Error code
message string The error, as a message
error AudioTrackDrmError Typed DRM failure when the host provider reports one. Exactly one of blockedByStreamLimit | notEntitled | expired | network | unknown. Unknown strings are coerced to unknown. Not a new listener.

DownloadEvent

Payload of the download listener.

Prop Type Description
downloadId string
state DownloadState
progress number 0..1
error DownloadError Set with failed, and with expired after a refused renewal.

AudioPlayerOptions

Options governing the overall behavior of the audio player plugin

Prop Type Description
verbose boolean Should the plugin's javascript dump the status message stream to the javascript console?
resetStreamOnPause boolean If true, when pausing a live stream, play will continue from the LIVE POSITION (e.g. the stream jumps forward to the current point in time, rather than picking up where it left off when you paused). If false, the stream will continue where you paused. The drawback of doing this is that when the audio buffer fills, it will jump forward to the current point in time, cause a disjoint in playback. Default is true.
stallTimeoutMs number How long, in milliseconds, playback position may fail to advance while the player reports it is playing before the plugin declares the track stalled and emits RMXSTATUS_STALLED (issue #143). Each platform's native "playing" signal (Android ExoPlayer's playbackState/isPlaying, iOS's AVPlayerItemPlaybackStalledNotification, the browser's waiting/stalled events) can fail to fire on a mid-stream network loss, so all three platforms poll actual position as a backstop and use this shared threshold for it. Default is 10000 (10s).
options NotificationOptions Further options for notifications

NotificationOptions

Prop Type
icon string

PlaylistOptions

Prop Type
items AudioTrack[]
options PlaylistItemOptions

PlaylistItemOptions

Options governing how the items are managed when using setPlaylistItems to update the playlist. This is typically useful if you are retaining items that were in the previous list.

Prop Type Description
retainPosition boolean If true, the plugin will continue playback from the current playback position after setting the items to the playlist.
playFromPosition number If retainPosition is true, this value will tell the plugin the exact time to start from, rather than letting the plugin decide based on current playback.
playFromId string If retainPosition is true, this value will tell the plugin the uid of the "current" item to start from, rather than letting the plugin decide based on current playback.
startPaused boolean If playback should immediately begin when calling setPlaylistItems on the plugin. Default is false;

AddItemOptions

Prop Type Description
item AudioTrack
index number 0-based index to insert at. Omit to append.

MoveItemOptions

Prop Type Description
from number Source index (0-based).
to number Destination index (0-based) after removal.

ReplaceItemOptions

Prop Type Description
item AudioTrack Replacement track data. When trackId is omitted the existing id is kept.
index number Index of the track to replace (preferred over id).
id string Id of the track to replace.

AddAllItemOptions

Prop Type
items AudioTrack[]

RemoveItemOptions

Prop Type
id string
index number

RemoveItemsOptions

Prop Type
items RemoveItemOptions[]

GetPlaylistResult

Prop Type
items AudioTrack[]

SeekToOptions

Prop Type
position number

PlayByIndexOptions

Prop Type
index number
position number

PlayByIdOptions

Prop Type
id string
position number

SelectByIndexOptions

Prop Type
index number
position number

SelectByIdOptions

Prop Type
id string
position number

SetPlaybackVolumeOptions

Prop Type
volume number

SetLoopOptions

Prop Type
loop boolean

SetPlaybackRateOptions

Prop Type
rate number

ResumeAfterVideoHandoffResult

Prop Type Description
resumed boolean true when native already handled seek (and play when requested) in place. When true, JS should skip redundant seekTo / play to avoid a stutter. false on web, prewarm, and paused Android handoff (native does not auto-play).

ResumeAfterVideoHandoffOptions

Prop Type Description
position number Resume position in seconds (video exit head or saved audio position).
prewarm boolean Android only. When true, promote MediaService to foreground and prepare at position without requesting audio focus or playing audio. Use immediately after prepareForVideoHandoff and before native video starts, while the app is still foregrounded. Ignored on iOS (no-op). Not applicable on web.
play boolean When true, native starts audible playback after seeking to position. When false (paused video exit), native must not start playback. iOS defaults to false when omitted; Android defaults to true for legacy callers.

GetLastKnownPositionResult

Prop Type
position number

StartDownloadOptions

Prop Type Description
downloadId string Stable id chosen by the app; also the id later set as AudioTrack.downloadId.
url string HLS playlist (audio.m3u8). May be re-signed on a resumed start. Android reuses cached segments; iOS starts a new task and discards partial media.
mimeType string Defaults to HLS (application/x-mpegURL).
drm AudioTrackDrmOptions Descriptor handed to the host provider's acquire. Omit for unpackaged (clear) HLS.

DownloadIdOptions

Prop Type
downloadId string

RenewDownloadOptions

Prop Type Description
downloadId string
drm AudioTrackDrmOptions Descriptor handed to the host provider's renew.

DownloadInfo

One entry of listDownloads.

Prop Type Description
downloadId string
state DownloadState
progress number 0..1
expiresAt number | null Licence expiry (epoch ms) from the host provider. null before the licence exists.
needsRenewal boolean The host provider asks for a renewal soon.

Type Aliases

PlaylistStatusChangeCallback

(data: PlaylistStatusChangeCallbackArg): void

AudioTrackDrmError

Exactly the five DRM error discriminators. Emitted on the existing status channel as value.error (do not overload numeric RmxAudioErrorType 0–4).

'blockedByStreamLimit' | 'notEntitled' | 'expired' | 'network' | 'unknown'

DownloadState

Lifecycle states of an offline download (download event and listDownloads).

'queued' | 'downloading' | 'completed' | 'failed' | 'expired'

DownloadError

Error discriminators of offline downloads: the five DRM discriminators plus offlineDeviceLimit (the user already holds offline licences on the maximum number of devices).

AudioTrackDrmError | 'offlineDeviceLimit'

Enums

RmxAudioStatusMessage

Members Value Description
RMXSTATUS_NONE 0 The starting state of the plugin. You will never see this value; it changes before the callbacks are even registered to report changes to this value.
RMXSTATUS_REGISTER 1 Raised when the plugin registers the callback handler for onStatus callbacks. You will probably not be able to see this (nor do you need to).
RMXSTATUS_INIT 2 Reserved for future use
RMXSTATUS_ERROR 5 Indicates an error is reported in the 'value' field.
RMXSTATUS_LOADING 10 The reported track is being loaded by the player
RMXSTATUS_CANPLAY 11 The reported track is able to begin playback
RMXSTATUS_LOADED 15 The reported track has loaded 100% of the file (either from disc or network)
RMXSTATUS_STALLED 20 Playback has stalled - the player is still trying, but position is not advancing. Raised on all three platforms: from each platform's own stall signal where it fires, and otherwise from a position-freeze poll gated by AudioPlayerOptions.stallTimeoutMs. Emitted once per stall episode; the track's reported status reads "stalled" until position advances again.
RMXSTATUS_BUFFERING 25 Reports an update in the reported track's buffering status
RMXSTATUS_PLAYING 30 The reported track has started (or resumed) playing
RMXSTATUS_PAUSE 35 The reported track has been paused, either by the user or by the system. (iOS only): This value is raised when MP3's are malformed (but still playable). These require the user to explicitly press play again. This can be worked around and is on the TODO list.
RMXSTATUS_PLAYBACK_POSITION 40 Reports a change in the reported track's playback position. Suppressed while the WebView is backgrounded, and (Android/iOS) while the track is stalled - so a frozen position is never reported as if playback were healthy.
RMXSTATUS_SEEK 45 The reported track has seeked. On Android, only the plugin consumer can generate this (Notification controls on Android do not include a seek bar). On iOS, the Command Center includes a seek bar so this will be reported when the user has seeked via Command Center.
RMXSTATUS_COMPLETED 50 The reported track has completed playback.
RMXSTATUS_DURATION 55 The reported track's duration has changed. This is raised once, when duration is updated for the first time. For streams, this value is never reported.
RMXSTATUS_STOPPED 60 All playback has stopped, probably because the plugin is shutting down.
RMX_STATUS_SKIP_FORWARD 90 The playlist has skipped forward to the next track. On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip. It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs, so you can generalize your track change handling in one place.
RMX_STATUS_SKIP_BACK 95 The playlist has skipped back to the previous track. On both Android and iOS, this will be raised if the notification controls/Command Center were used to skip. It is unlikely you need to consume this event: RMXSTATUS_TRACK_CHANGED is also reported when this occurs, so you can generalize your track change handling in one place.
RMXSTATUS_TRACK_CHANGED 100 Reported when the current track has changed in the native player. This event contains full data about the new track, including the index and the actual track itself. The type of the 'value' field in this case is OnStatusTrackChangedData.
RMXSTATUS_PLAYLIST_COMPLETED 105 The entire playlist has completed playback. After this event has been raised, the current item is set to null and the current index to -1.
RMXSTATUS_ITEM_ADDED 110 An item has been added to the playlist. For the setPlaylistItems and addAllItems methods, this status is raised once for every track in the collection.
RMXSTATUS_ITEM_REMOVED 115 An item has been removed from the playlist. For the removeItems and clearAllItems methods, this status is raised once for every track that was removed.
RMXSTATUS_ITEM_MOVED 112 An item has been moved within the playlist.
RMXSTATUS_ITEM_REPLACED 113 An item in the playlist has been replaced in place.
RMXSTATUS_PLAYLIST_CLEARED 120 All items have been removed from the playlist
RMXSTATUS_VIEWDISAPPEAR 200 Just for testing.. you don't need this and in fact can never receive it, the plugin is destroyed before it can be raised.

RmxAudioErrorType

Members Value Description
RMXERR_NONE_ACTIVE 0 No active source to play. You are unlikely to see this.
RMXERR_ABORTED 1 Playback was aborted, typically because the source was torn down mid-load. Web only, from MediaError.MEDIA_ERR_ABORTED.
RMXERR_NETWORK 2 The source is fine but could not be reached or read - a dropped connection, a timeout, a bad HTTP status. This is the retry-able error: the same URL may well succeed once connectivity returns. Android: media3's ERROR_CODE_IO_* network codes. iOS: an NSError in NSURLErrorDomain / NSPOSIXErrorDomain. Web: MediaError.MEDIA_ERR_NETWORK.
RMXERR_DECODE 3 The media was reached but could not be decoded. Not retry-able. Android: media3's decoder error codes. iOS: AVFoundationErrorDomain decode and parse failures. Web: MediaError.MEDIA_ERR_DECODE.
RMXERR_NONE_SUPPORTED 4 The source itself is unusable - missing, the wrong container, or a body that does not parse as what it claims to be. Not retry-able; skip the track. Also the fallback when a platform reports a failure that does not classify.