Agora RTC Objective-C API Reference Refactor

Instance Methods
<AgoraMusicContentCenterEventDelegate> Protocol Reference

Inherits <NSObjectNSObject>.

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

## Detailed Description

The request event delegate callback

## Method Documentation

## ◆ onMusicChartsResult:result:reason:

- (void) onMusicChartsResult: |  | (NSString *) | requestId
result: |  | (NSArray< AgoraMusicChartInfo * > *) | result
reason: |  | (AgoraMusicContentCenterStateReason) | reason

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
  reason | The status of the request. See MusicContentCenterStateReason

## ◆ onMusicCollectionResult:result:reason:

- (void) onMusicCollectionResult: |  | (NSString *) | requestId
result: |  | (AgoraMusicCollection *) | result
reason: |  | (AgoraMusicContentCenterStateReason) | reason

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
  reason | The status of the request. See MusicContentCenterStateReason

## ◆ onLyricResult:songCode:lyricUrl:reason:

- (void) onLyricResult: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
lyricUrl: |  | (NSString *_Nullable) | lyricUrl
reason: |  | (AgoraMusicContentCenterStateReason) | reason

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
  reason | The status of the request. See MusicContentCenterStateReason

## ◆ onSongSimpleInfoResult:songCode:simpleInfo:reason:

- (void) onSongSimpleInfoResult: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
simpleInfo: |  | (NSString *_Nullable) | simpleInfo
reason: |  | (AgoraMusicContentCenterStateReason) | reason

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.
  reason | The status of the request. See MusicContentCenterStateReason

## ◆ onPreLoadEvent:songCode:percent:lyricUrl:state:reason:

- (void) onPreLoadEvent: |  | (NSString *) | requestId
songCode: |  | (NSInteger) | songCode
percent: |  | (NSInteger) | percent
lyricUrl: |  | (NSString *_Nullable) | lyricUrl
state: |  | (AgoraMusicContentCenterPreloadState) | state
reason: |  | (AgoraMusicContentCenterStateReason) | reason

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
  state | Preload state; see PreloadState.
  reason | The status of the request. See MusicContentCenterStateReason