Skip to main content
Version: v3.0.0 (current)

AutoPlayOptions

The autoPlay manager option. In 3.0.0 it replaces the top-level autoPlaySearchPlatforms and lastFmApiKey options, which are now ignored.

  • Autoplay asks platforms first, in order, skipping those the node does not have enabled, then Last.fm (with lastFmApiKey) when none of them recommends a track. Last.fm is the only source when platforms is empty or none of its platforms is enabled on the node.
  • requestTimeoutMs bounds the requests autoplay sends itself (Last.fm and the SoundCloud recommendations page). The requests to the node use the node option apiRequestTimeoutMs.
  • recentTracksToSkip must be at least 1; a value out of range makes new Manager() throw MANAGER_INVALID_CONFIG.
  • Autoplay skips recommendations on the blockedDomains manager option.

Definition​

/** The `autoPlay` manager option. */
export interface AutoPlayOptions {
/** The platforms autoplay asks for recommendations, first to last. Use enum `AutoPlayPlatform`.
* @default [AutoPlayPlatform.YouTube]
*/
platforms?: AutoPlayPlatform[];
/** The last.fm API key. Last.fm backs up `platforms` when none of them recommends a track, and is the only autoplay
* source when none of them is set or enabled on the node.
* If you need to create one go here: https://www.last.fm/api/account/create.
* If you already have one, get it from here: https://www.last.fm/api/accounts. */
lastFmApiKey?: string;
/** How long a request autoplay sends itself, to Last.fm or to the SoundCloud recommendations page, can take, in
* milliseconds. The requests to the node use the node option `apiRequestTimeoutMs`.
* @default 10000
*/
requestTimeoutMs?: number;
/** How many of the last played tracks autoplay avoids picking again. When every recommendation is among them,
* autoplay only avoids the track that just ended. It cannot look further back than `maxPreviousTracks`.
* @default maxPreviousTracks
*/
recentTracksToSkip?: number;
}