Playlist Object

The playlist object is no longer available in the SDK version 2.

You can use the getCurrentPlaylist method to get the playlist information.

Besides that, we also have the getAllPlaylists() and getPlaylist(playlistId) methods to help you get more playlist information. Please check the README.md for more details.

playlist Object

Function or PropertyDescriptionReturns
playlistThe playlist objectThe playlist object
goToPageId(pageId)Goes to the page as specified by the ID. You'll need to determine the ID of the page first by retrieving a list of the pages.null
goToPageName(pageName)Go to the page as specified by the Name of the page.null
nextPage()Go to the next page in the playlist.null
previousPage()Go to the previous page in the playlist.null
pause()Pause playlist playback.null
play()Resuming playing playlist playback.null

Playlist Object Properties

PropertyDescriptionType
idThe ID of the playliststring
pagesAn array of pages objects representing the pages in the playlistarray
nameThe name of the playliststring
stateWhether the playlist is 'playing' or 'paused'string

Code Samples

import { getCurrentPlaylist } from '@telemetrytv/sdk'

getCurrentPlaylist().then((playlist) => {
  console.log('The current playlist name is:', playlist.name)
})

What’s Next