Get BGM playback status
1. API Description
This API is used to get the BGM playback status.
Request mode:
- V2.6.0 and above: POST [ip]/mwapi/V2.0/bgm/get-bgm-status
- V2.5.0 and below: POST [ip]/mwapi/get-bgm-status
| Administrator Rights | Logged-in |
|---|---|
| No | Yes |
2. Input Parameters
None
3. Output Parameters
| Name | Type | Description |
|---|---|---|
| result | Int | Status code |
| message | String | Status description |
| info | InfoData | BGM information |
InfoData
| Name | Type | Description |
|---|---|---|
| musicStatus | MusicStatusInfo | BGM status |
MusicStatusInfo
| Name | Type | Description |
|---|---|---|
| Status | Int | Playback status 0: Pause; 1: Play |
| progress | Int | Playback progress, ranging from 0 to 1000000 |
| policy | Int | Playback policy 1: Play by order 2: Shuffle 3: Loop one 4: Loop all |
| duration | Int | Duration, in ms |
| currentMusicId | Int | The resource ID of current BGM, that is the unique identifier of the audio file in the device |
4. Example
Getting the BGM playback status.
Input Example
None
Output Example
{
"info": {
"musicStatus": {
"currentMusicId": 2006,
"duration": 217000,
"policy": 2,
"progress": 500000,
"status": 0
}
},
"message": "success",
"result": 0
}
5. Error Code
No error code related to the API business logic. For other error codes, see Common Error Codes.