import SharedPlaylistFetcher from '@kkbox/kkbox-js-sdk/src/api/SharedPlaylistFetcher.js'
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 |
setPlaylistID(playlistID: string): SharedPlaylistFetcher 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.
Example:
api.sharedPlaylistFetcher
.setPlaylistID('4nUZM-TY2aVxZ2xaA-')
.fetchMetadata();
public fetchTracks(limit: number, offset: number): Promise source
Fetch track list of a shared playlist.
Example:
api.sharedPlaylistFetcher
.setPlaylistID('4nUZM-TY2aVxZ2xaA-')
.fetchTracks();
public getWidgetUri(): string source
Get KKBOX web widget uri of the playlist.
Example:
https://widget.kkbox.com/v1/?id=KmjwNXizu5MxHFSloP&type=playlist
public setPlaylistID(playlistID: string): SharedPlaylistFetcher source
Init the shared playlist fetcher.
Params:
Name | Type | Attribute | Description |
playlistID | string | The ID of a playlist. |