@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

    Constructors

    • Parameters

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

      Returns PlayQueue

    Properties

    identifier: string

    PlayQueue identifier

    key: string

    plex relative url

    mediaTagPrefix: string

    Media tag prefix path

    mediaTagVersion: number

    Media tag version number

    parent?: WeakRef<any>

    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: number

    ID of the currently selected item, matches ratingKey

    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

    selectedItem?: Playable

    Media object for the currently selected item

    server: PlexServer
    size: number

    Total size of the PlayQueue (alias for playQueueTotalCount)

    TAG: string = 'PlayQueue'

    xml element tag

    TYPE: string = 'playqueue'

    xml element type

    Accessors

    • get items(): Playable[]

      Get items in the PlayQueue.

      Returns Playable[]

    • get length(): number

      Get the length of the PlayQueue.

      Returns number

    Methods

    • Append an item to the "Up Next" section of the PlayQueue.

      Parameters

      • item: Playable | Playlist
      • options: AddPlayQueueItemOptions = {}

      Returns Promise<PlayQueue>

    • Remove all items from the PlayQueue.

      Returns Promise<PlayQueue>

    • Check if the PlayQueue contains the provided media item.

      Parameters

      • media: Playable

      Returns boolean

    • Get item at specific index.

      Parameters

      • index: number

      Returns Playable

    • 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 is a child of the given class.

      Parameters

      • cls: any

      Returns boolean

    • Move an item to the beginning of the PlayQueue. If 'after' is provided, the item will be placed immediately after the specified item.

      Parameters

      • item: Playable
      • options: MovePlayQueueItemOptions = {}

      Returns Promise<PlayQueue>

    • Refresh the PlayQueue from the Plex server.

      Returns Promise<void>

    • Reload the data for this object from this.key.

      Parameters

      • Optionalekey: string

      Returns Promise<void>

    • Remove an item from the PlayQueue.

      Parameters

      • item: Playable
      • refresh: boolean = true

      Returns Promise<PlayQueue>

    • Create and return a new PlayQueue.

      Parameters

      • server: PlexServer
      • items: Playable | Playlist | Playable[]
      • options: CreatePlayQueueOptions = {}

      Returns Promise<PlayQueue>

    • Create and return a new PlayQueue from a station key. This is a convenience method for radio stations.

      Parameters

      Returns Promise<PlayQueue>

    • Retrieve an existing PlayQueue by identifier.

      Parameters

      • server: PlexServer
      • playQueueID: number
      • options: GetPlayQueueOptions = {}

      Returns Promise<PlayQueue>