@ctrl/plex
    Preparing search index...

    Class PlayQueue

    Control a PlayQueue.

    A PlayQueue is a linear list of media items that can be played in sequence. It represents the current playback queue and supports operations like adding, removing, and reordering items.

    Hierarchy

    • PlexObject
      • PlayQueue
    Index
    • Parameters

      • server: PlexServer
      • data: unknown
      • Optionalinitpath: string
      • Optionalparent: PlexObject

      Returns PlayQueue

    identifier: string

    PlayQueue identifier

    key?: string

    Plex relative url, when the payload includes one.

    mediaTagPrefix: string

    Media tag prefix path

    mediaTagVersion: number

    Media tag version number

    parent?: WeakRef<PlexObject>

    WeakRef to the parent object that this object is built from.

    playQueueID: number

    Unique ID of the PlayQueue

    playQueueLastAddedItemID?: number

    ID of the last added item, defines where "Up Next" region starts

    playQueueSelectedItemID: number

    The queue item ID of the currently selected item

    playQueueSelectedItemOffset: number

    The offset of the selected item in the PlayQueue

    playQueueSelectedMetadataItemID?: string

    Rating key of the currently selected item.

    playQueueShuffled: boolean

    True if the PlayQueue is shuffled

    playQueueSourceURI: string

    Original URI used to create the PlayQueue

    playQueueTotalCount: number

    Total number of items in the PlayQueue

    playQueueVersion: number

    Version of the PlayQueue, increments on changes

    server: PlexServer
    size: number

    Total size of the PlayQueue (alias for playQueueTotalCount)

    TAG: string = 'PlayQueue'

    xml element tag

    TYPE: string = 'playqueue'

    xml element type

    • get items(): QueueItem[]

      Get items in the PlayQueue.

      Returns QueueItem[]

    • get length(): number

      Get the length of the PlayQueue.

      Returns number

    • get selectedItem(): QueueItem | undefined

      The currently selected item, when it is inside the loaded window of the PlayQueue.

      Returns QueueItem | undefined

    • Check if the PlayQueue contains the provided media item.

      Parameters

      • media: Playable

      Returns boolean

    • Get item at specific index.

      Parameters

      • index: number

      Returns Playable | null

    • Get a similar object from this PlayQueue. Useful for looking up playQueueItemIDs using items from the Library.

      Parameters

      • item: Playable

      Returns Playable

    • Returns true if this object was built from a parent of the given class.

      Parameters

      • cls: new (...args: any[]) => PlexObject

      Returns boolean

    • Refresh the PlayQueue from the Plex server.

      Returns Promise<void>

    • Build the parameters used by server and client play queue creation commands.

      Parameters

      Returns Promise<Record<string, string | number | boolean>>