AutoPlayOptions
The autoPlay manager option. In 3.0.0 it replaces the top-level autoPlaySearchPlatforms and
lastFmApiKey options, which are now ignored.
- Autoplay asks
platformsfirst, in order, skipping those the node does not have enabled, then Last.fm (withlastFmApiKey) when none of them recommends a track. Last.fm is the only source whenplatformsis empty or none of its platforms is enabled on the node. requestTimeoutMsbounds the requests autoplay sends itself (Last.fm and the SoundCloud recommendations page). The requests to the node use the node optionapiRequestTimeoutMs.recentTracksToSkipmust be at least1; a value out of range makesnew Manager()throwMANAGER_INVALID_CONFIG.- Autoplay skips recommendations on the
blockedDomainsmanager 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;
}