Agora Java API Reference for Android
Classes | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
io.agora.musiccontentcenter.IAgoraMusicContentCenter Class Referenceabstract

Classes

class  MusicCacheStatusType
 
class  MusicContentCenterStatusCode
 
class  PreloadStatusCode
 

Public Member Functions

abstract int initialize (MusicContentCenterConfiguration configuration)
 
abstract int renewToken (String token)
 
abstract IAgoraMusicPlayer createMusicPlayer ()
 
abstract int registerEventHandler (IMusicContentCenterEventHandler eventHandler)
 
abstract int unregisterEventHandler ()
 
abstract int preload (long songCode, String jsonOption)
 
abstract int isPreloaded (long songCode)
 
abstract String getMusicCharts ()
 
String getMusicCollectionByMusicChartId (int musicChartId, int page, int pageSize)
 
abstract String getMusicCollectionByMusicChartId (int musicChartId, int page, int pageSize, String jsonOption)
 
String searchMusic (String keyword, int page, int pageSize)
 
abstract String searchMusic (String keyword, int page, int pageSize, String jsonOption)
 
abstract String getLyric (long songCode, int lyricType)
 
abstract int removeCache (long songCode)
 
abstract MusicCacheInfo[] getCaches ()
 

Static Public Member Functions

static synchronized IAgoraMusicContentCenter create (RtcEngine rtcEngine)
 
static synchronized void destroy ()
 

Protected Member Functions

abstract void release ()
 

Member Function Documentation

◆ initialize()

abstract int io.agora.musiccontentcenter.IAgoraMusicContentCenter.initialize ( MusicContentCenterConfiguration  configuration)
abstract

set coryright music token and other param

Parameters
configuration
Returns
  • 0: Success.
  • < 0: Failure.

◆ renewToken()

abstract int io.agora.musiccontentcenter.IAgoraMusicContentCenter.renewToken ( String  token)
abstract

Renew token of music content center

Parameters
tokenThe new token.
Returns
  • 0: Success.
  • < 0: Failure.

◆ createMusicPlayer()

abstract IAgoraMusicPlayer io.agora.musiccontentcenter.IAgoraMusicContentCenter.createMusicPlayer ( )
abstract

Creates a music player source object and return its pointer.

Returns
  • The pointer to IMusicPlayer, if the method call succeeds.
  • The empty pointer NULL, if the method call fails.

◆ preload()

abstract int io.agora.musiccontentcenter.IAgoraMusicContentCenter.preload ( long  songCode,
String  jsonOption 
)
abstract

preload a media file with specified parameters.

Parameters
songCodeThe identify of the media file that you want to play.
jsonOptionThe ext param, default is null.
Returns
  • 0: Success.
  • < 0: Failure.

◆ isPreloaded()

abstract int io.agora.musiccontentcenter.IAgoraMusicContentCenter.isPreloaded ( long  songCode)
abstract

check if the media file is preloaded

Parameters
songCodeThe identify of the media file that you want to play.
Returns
  • 0: Success, file is preloaded.
  • < 0: Failure.

◆ getMusicCharts()

abstract String io.agora.musiccontentcenter.IAgoraMusicContentCenter.getMusicCharts ( )
abstract

Get music chart list of music.

Returns
  • 0: Success.
  • < 0: Failure.

◆ getMusicCollectionByMusicChartId() [1/2]

String io.agora.musiccontentcenter.IAgoraMusicContentCenter.getMusicCollectionByMusicChartId ( int  musicChartId,
int  page,
int  pageSize 
)

Get song list of the music chart by musicChartId and page info.

Parameters
musicChartIdThe musicChartId id from getMusicCharts.
pageThe page, start from 1.
pageSizeThe page size, max is 50.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getMusicCollectionByMusicChartId() [2/2]

abstract String io.agora.musiccontentcenter.IAgoraMusicContentCenter.getMusicCollectionByMusicChartId ( int  musicChartId,
int  page,
int  pageSize,
String  jsonOption 
)
abstract

Get song list of the music chart by musicChartId and page info.

Parameters
musicChartIdThe musicChartId id from getMusicCharts.
pageThe page, start from 1.
pageSizeThe page size, max is 50.
jsonOptionThe ext param, default is null.
Returns
  • 0: Success.
  • < 0: Failure.

◆ searchMusic() [1/2]

String io.agora.musiccontentcenter.IAgoraMusicContentCenter.searchMusic ( String  keyword,
int  page,
int  pageSize 
)

Get hot song list by musicChartId and page info.

Parameters
keywordThe key word to search.
pageThe page, start from 1.
pageSizeThe page size, max is 50.
Returns
  • 0: Success.
  • < 0: Failure.

◆ searchMusic() [2/2]

abstract String io.agora.musiccontentcenter.IAgoraMusicContentCenter.searchMusic ( String  keyword,
int  page,
int  pageSize,
String  jsonOption 
)
abstract

Get hot song list by musicChartId and page info.

Parameters
keywordThe key word to search.
pageThe page, start from 1.
pageSizeThe page size, max is 50.
jsonOptionThe ext param, default is null.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getLyric()

abstract String io.agora.musiccontentcenter.IAgoraMusicContentCenter.getLyric ( long  songCode,
int  lyricType 
)
abstract

get lyric of the song.

Parameters
songCodeThe identifier of the media file that you want to play.
lyricTypeThe type of the lyric file. may be 0:xml or 1:lrc.
Returns
  • 0: Success.
  • < 0: Failure.

◆ removeCache()

abstract int io.agora.musiccontentcenter.IAgoraMusicContentCenter.removeCache ( long  songCode)
abstract

remove song cache.

Parameters
songCodeThe identifier of the media file that you want to play.
Returns
  • 0: Success.
  • < 0: Failure.

◆ getCaches()

abstract MusicCacheInfo [] io.agora.musiccontentcenter.IAgoraMusicContentCenter.getCaches ( )
abstract

Get media cache files.

Returns
The array of MusicCacheInfo.