Music event
Type Definitions
onStart(idopt, errCodeopt)
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Background music ID |
errCode |
Number |
0: Start playing successfully; -4001: Failed to open the file, such as the audio file format is not supported, the local audio file does not exist, the network audio file cannot be accessed, etc. |
onPlayProgress(idopt, curPtsMSopt, durationMSopt)
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Background music ID |
curPtsMS |
Number |
current playing timestamp in ms |
durationMS |
Number |
music duration time in ms |
onComplete(idopt, errCodeopt)
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Background music ID |
errCode |
Number |
0: End of play; -4002: Decoding failure, such as audio file corruption, inaccessible network audio file server, etc. |
onLoadProgress(idopt, progressopt)
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Background music ID |
progress |
Number |
Loading progress |
onLoadError(idopt, errorCodeopt)
Parameters:
Name | Type | Description |
---|---|---|
id |
Number |
Background music ID |
errorCode |
Number |
errorCode
|