open [1/2]
Opens a music resource using the resource ID.
int open(long songCode, long startPos);
After calling this method, the onPlayerStateChanged callback is triggered. When you receive the OPEN_COMPLETED state, you can call the play method to play the media file.
Note: If the music resource to be opened is protected by digital rights management, you must use this method. For music resources not protected by digital rights management, you can use this method or the
open method with parameters String url, long startPos.Parameters
- songCode
- The resource ID of the music resource, used to identify the music.
- startPos
- The starting playback position in milliseconds. (Default is 0)
Return Values
- 0: Success.
- < 0: Failure.