Agora RTC Objective-C API Reference Refactor

Instance Methods
<AgoraMusicContentCenterEventDelegate> Protocol Reference

Inherits <NSObjectNSObject>.

## Instance Methods
(void) | - onMusicChartsResult:result:errorCode:
(void) | - onMusicCollectionResult:result:errorCode:
(void) | - onLyricResult:songCode:lyricUrl:errorCode:
(void) | - onSongSimpleInfoResult:songCode:simpleInfo:errorCode:
(void) | - onPreLoadEvent:songCode:percent:lyricUrl:status:errorCode:

## Detailed Description

The request event delegate callback

## Method Documentation

## ◆ onMusicChartsResult:result:errorCode:

- (void) onMusicChartsResult: |  | (NSString *) | requestId
result: |  | (NSArray< AgoraMusicChartInfo * > *) | result
errorCode: |  | (AgoraMusicContentCenterStatusCode) | errorCode

The music chart result callback; occurs when getMusicCharts method is called.

Parameters

  requestId | The request id is same as that returned by getMusicCharts.
  result | The result of music chart collection
  errorCode | The status of the request. See MusicContentCenterStatusCode

## ◆ onMusicCollectionResult:result:errorCode:

- (void) onMusicCollectionResult: |  | (NSString *) | requestId
result: |  | (AgoraMusicCollection *) | result
errorCode: |  | (AgoraMusicContentCenterStatusCode) | errorCode

Music collection, occurs when getMusicCollectionByMusicChartId or searchMusic method is called.

Parameters

  requestId | The request id is the same with that returned by getMusicCollectionByMusicChartId or searchMusic
  result | The result of music collection
  errorCode | The status of the request. See MusicContentCenterStatusCode

## ◆ onLyricResult:songCode:lyricUrl:errorCode:

- (void) onLyricResult: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
lyricUrl: |  | (NSString *_Nullable) | lyricUrl
errorCode: |  | (AgoraMusicContentCenterStatusCode) | errorCode

Lyric url callback of getLyric, occurs when getLyric is called

Parameters

  requestId | The request id is same as that returned by getLyric
  songCode | Song code
  lyricUrl | The lyric url of this music
  errorCode | The status of the request. See MusicContentCenterStatusCode

## ◆ onSongSimpleInfoResult:songCode:simpleInfo:errorCode:

- (void) onSongSimpleInfoResult: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
simpleInfo: |  | (NSString *_Nullable) | simpleInfo
errorCode: |  | (AgoraMusicContentCenterStatusCode) | errorCode

Simple info callback of getSongSimpleInfo, occurs when getSongSimpleInfo is called

Parameters

  requestId | The request id is same as that returned by getSongSimpleInfo.
  songCode | Song code
  simpleInfo | The metadata of the music.
  errorCode | The status of the request. See MusicContentCenterStatusCode

## ◆ onPreLoadEvent:songCode:percent:lyricUrl:status:errorCode:

- (void) onPreLoadEvent: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
percent: |  | (NSInteger) | percent
lyricUrl: |  | (NSString *_Nullable) | lyricUrl
status: |  | (AgoraMusicContentCenterPreloadStatus) | status
errorCode: |  | (AgoraMusicContentCenterStatusCode) | errorCode

Preload process callback, occurs when preload is called

Parameters

  requestId | The request id is same as that returned by preload.
  songCode | Song code
  percent | Preload progress (0 ~ 100)
  lyricUrl | The lyric url of this music
  status | Preload status; see PreloadStatusCode.
  errorCode | The status of the request. See MusicContentCenterStatusCode