preload [2/2]
Preloads copyright music resources.
public abstract String preload(long songCode);
After successfully calling this method, the SDK triggers the onPreLoadEvent callback to report preload events. Before calling this method, you need to call getMusicCollectionByMusicChartId or searchMusic to obtain the copyright music resources you want to play, and use the onMusicCollectionResult callback triggered by these methods to get the music resource identifier (songCode).
Note: Before destroying the RtcEngine object, make sure to call the destroy [2/2] method after receiving the onPreLoadEvent callback.
Parameters
- songCode
- The identifier of the copyright music resource.
Return Values
- On success, returns the unique identifier
requestIdfor the request. - On failure, returns an empty string.