Home Reference Source
import SharedPlaylistFetcher from '@kkbox/kkbox-js-sdk/src/api/SharedPlaylistFetcher.js'
public class | source

SharedPlaylistFetcher

Extends:

Fetcher → SharedPlaylistFetcher

Get playlist metadata.

See:

Method Summary

Public Methods
public

Fetch metadata of the shared playlist with the shared playlist fetcher.

public

fetchTracks(limit: number, offset: number): Promise

Fetch track list of a shared playlist.

public

Get KKBOX web widget uri of the playlist.

public

Init the shared playlist fetcher.

Inherited Summary

From class Fetcher
public

fetchNextPage(fulfillment: fulfillment, nextUriPath: String): Promise

Fetches next page of various paged APIs.

public

hasNextPage(fulfillment: fulfillment, nextUriPath: String): Boolean

Is next page available for various paged APIs.

public

setTerritory(territory: string): Fetcher

Set the fetcher's territory.

Public Methods

public fetchMetadata(): Promise source

Fetch metadata of the shared playlist with the shared playlist fetcher.

Return:

Promise

Example:

 api.sharedPlaylistFetcher
   .setPlaylistID('4nUZM-TY2aVxZ2xaA-')
   .fetchMetadata();

See:

public fetchTracks(limit: number, offset: number): Promise source

Fetch track list of a shared playlist.

Params:

NameTypeAttributeDescription
limit number
  • optional

The size for one page.

offset number
  • optional

The offset index for first element.

Return:

Promise

Example:

 api.sharedPlaylistFetcher
   .setPlaylistID('4nUZM-TY2aVxZ2xaA-')
   .fetchTracks();

See:

public getWidgetUri(): string source

Get KKBOX web widget uri of the playlist.

Return:

string

Example:

https://widget.kkbox.com/v1/?id=KmjwNXizu5MxHFSloP&type=playlist

public setPlaylistID(playlistID: string): SharedPlaylistFetcher source

Init the shared playlist fetcher.

Params:

NameTypeAttributeDescription
playlistID string

The ID of a playlist.

See: