play
play
- play(
params):Promise<CallPlayback>
Play one or multiple media in a Call and waits until the playing has ended.
The play method is a generic method for all types of media, see playAudio, playSilence, playTTS or playRingtone for more specific usages.
Parameters
params
Object containing the parameters for playing media.
playlist
A media playlist. See VoicePlaylist.
Returns
Promise<CallPlayback>
A promise that resolves to a CallPlayback object that you can use to
view the current state and results of the play session.
Example
In this example, we dial a phone number and play a TTS message. Once the TTS message is finished playing, we then play silence on the call for 1 second and then play an audio file. Once the audio file is finished playing, we hangup the call.