InnerAudioContext.play(params: Object)
Requires:
BaseKit≥2.3.2
Platforms:
iOSAndroid
Description
Play
Parameters
| Property | Type | Required | Default | Description |
|---|---|---|---|---|
src | string | Yes | - | src URL of the audio resource |
startTime | number | No | 0 | startTime Start position, in seconds. Precision to 3 decimal places (ms-level accuracy) |
autoplay | boolean | No | false | autoplay Whether to start playing automatically |
loop | boolean | No | false | Whether to loop playback; default: false |
volume | number | No | 1.0 | Volume, range 0–1. Default: 1 |
playbackRate | number | No | 1.0 | Playback rate, range 0.5–2.0; default: 1. (Android 6 or above required) |
complete | () => void | No | - | Completion callback (executed on both success and failure) |
success | () => void | No | - | Callback on successful API call |
fail | (params: Object) => void | No | - | Failure callback |
fail callback parameters
| Property | Type | Description |
|---|---|---|
errorMsg | string | Error message |
errorCode | string | number | Error code |
| Error extension |
Return Value
None