Participant
Represents a CCAI participant instance.
Methods
addEventListener
addEventListener(event: , callback: Function
): void
Adds a handler for the specified CCAI.Events.Participant event. Use only functions as handlers; anything except a function leads to an error and scenario termination when a handler is called.
Parameters
event:
Event class (i.e., CCAI.Events.Participant.Created)
callback:
Function
Handler function. A single parameter is passed - object with event information
Returns
type:
void
addPlaybackMarker
addPlaybackMarker(offset: number
, playbackId: string
): void
Adds a Dialogflow speech synthesis playback marker. The CCAI.Events.Participant.MarkerReached event is triggered when the marker is reached.
Parameters
offset:
number
Marker
playbackId:
string
OptionalPlayback id
Returns
type:
void
analyzeContent
analyzeContent(query: | ): void
Adds a message from a participant into the Dialogflow CCAI.
Parameters
query:
Message
Returns
type:
void
id
id(): string
Returns the participant's id.
Returns
type:
string
removeEventListener
removeEventListener(event: , callback: Function
): void
Removes a handler for the specified CCAI.Events.Participant event.
Parameters
event:
Event class (i.e., CCAI.Events.Participant.Created)
callback:
Function
OptionalOptional. Handler function. If not specified, all handler functions are removed
Returns
type:
void
sendMediaTo
sendMediaTo(mediaUnit: , parameters: ): void
Starts sending media (voice) from the Dialogflow participant to the media unit.
Parameters
mediaUnit:
Media unit that receives media
parameters:
OptionalOptional. WebSocket interaction only parameters
Returns
type:
void
stopMediaTo
stopMediaTo(mediaUnit: ): void
Stops sending voice from the Dialogflow participant to the media unit.
Parameters
mediaUnit:
Media unit that stops receiving media
Returns
type:
void