# ManageBackgroundMusic
For managing background audio
# Call parameter
attribute | Introductions |
---|---|
showManageUI | Whether to display the management page |
forceRequestFullscreen | true Force the Mini Program to run full screen |
# Return parameters
attribute | Introductions |
---|---|
songName | Name of the music being played |
currentPos | Location played to, Unit: ms |
totalDuration | Track length, in ms |
pause | Whether the suspension |
# sample code
val request = WMPFManageBackgroundMusicRequest()
request.baseRequest = WMPFBaseRequestHelper.checked()
request.showManageUI = showManageUI
request.forceRequestFullscreen = forceRequestFullscreen
val result =
WMPFIPCInvoker.invokeAsync<IPCInvokerTask_ManageBackgroundMusic, WMPFManageBackgroundMusicRequest,
WMPFManageBackgroundMusicResponse>(
request,
IPCInvokerTask_ManageBackgroundMusic::class.java
) { response ->
if (isSuccess(response)) {
it.onSuccess(response)
} else {
it.onError(TaskErrorException(createTaskError(response)))
}
}
if (!result) {
it.onError(Exception("invoke manageBackgroundMusic fail"))
}