← Audio and media queue

Media.QueueItem

luastra/media

Media.QueueItem is an exported, statically checked data contract of luastra/media. Its exact declaration documents the fields or alternatives accepted at the module boundary and is erased after Luau analysis.

Before you use it

Add luastra/media to this module's dependencies in luastra.json, then import it with require("luastra/media"). Declare media.command in luastra.json. Set an admitted queue before playback, start playback from an explicit user action where required, and implement both app.resolve and media_state handling.

How it fits

The type describes queue input, live playback state, or the tagged state-decoding result.

When to use it

Use Media.QueueItem when annotating values that cross the public luastra/media boundary or when exporting helpers built on that module. The type documents the exact checked shape and prevents unrelated tables from being substituted accidentally.

Fields or definition

ParameterType / valuesDescription
idstringStable identifier used to correlate or address this value across operations.
sourcestringAdmitted asset or supported media source consumed by the host player.
titlestringUser-visible track title exposed by playback surfaces and host controls.
artiststringUser-visible creator or collection label exposed by playback surfaces.

What happens next

A checked media input/state/result annotation.

Failures and fixes

Missing capability, absent queue, invalid asset/content URI, autoplay policy, interruption, unsupported background behavior, or host failure must remain visible state. Do not optimistically treat command acknowledgement as playback success.

Availability

Public-source alpha API in 0.5.0-alpha; background playback and system controls require target-specific verification.

Exact declaration

export type QueueItem = { id: string, source: string, title: string, artist: string }

Continue learning

Companions

Media.StateMedia.state

Next steps

Media.setQueue

Complete inventory

View all pages in Audio and media queue
← Previous: Media.RequestIdNext: Media.MediaError →