onMusicCollectionResult
Callback for retrieving the music resource list.
void onMusicCollectionResult(String requestId, int page, int pageSize, int total, Music[] list, int reason)
This callback is triggered when calling getMusicCollectionByMusicChartId or searchMusic.
Parameters
- requestId
- Request ID, used to uniquely identify the request.
- page
- Current page number, starting from 1.
- pageSize
- Maximum number of music resources returned per page, up to 50.
- total
- Total number of resources in the music resource list.
- list
- Detailed information of the music resource list. See Music.
- reason
- Request status code from Agora Music Content Center:
MUSIC_CONTENT_CENTER_STATE_REASON_OK (0): Request successful.MUSIC_CONTENT_CENTER_STATE_REASON_ERROR (1): General error, no specific attribution.MUSIC_CONTENT_CENTER_STATE_REASON_GATEWAY (2): Gateway error. Possible reasons include:- The current temporary token has expired. Please regenerate the temporary token.
- The provided temporary token is invalid. Please ensure you are using an RTM token.
- Network error. Please check your network connection.
MUSIC_CONTENT_CENTER_STATE_REASON_PERMISSION_AND_RESOURCE (3): Permission error or music resource not found. Please ensure your project has enabled access to Agora Music Content Center. If you have questions, contact technical support.MUSIC_CONTENT_CENTER_STATE_REASON_INTERNAL_DATA_PARSE (4): Internal data parsing error. Please contact technical support.MUSIC_CONTENT_CENTER_STATE_REASON_MUSIC_LOADING (5): Error occurred while loading music resource. Please contact technical support.MUSIC_CONTENT_CENTER_STATE_REASON_MUSIC_DECRYPTION (6): Error occurred while decrypting music resource. Please contact technical support.MUSIC_CONTENT_CENTER_STATE_REASON_HTTP_INTERNAL (7): Internal HTTP error. Please try again later.