Class WebAvatar
Defined in: sdk.js.
Constructor Attributes | Constructor Name and Description |
---|---|
The WebAvatar provides access to an avatar and binds it to elements in an HTML document.
|
Field Attributes | Field Name and Description |
---|---|
The id or name of the avatar object to use.
|
|
Allow the background color to be set.
|
|
Only apply the background color if not Chrome.
|
|
Return if the avatar box is in a closed state.
|
|
An SDK connection object must be set.
|
|
Function to invoke when processing all messages is complete.
|
|
Set if the avatar should request a specific video or image format.
|
|
Set if the avatar should request HD (high def) video/images.
|
|
Avatar image/video height.
|
|
Set the language for the native voice.
|
|
Store list of messages to output.
|
|
Configure if the browser's native voice TTS should be used.
|
|
Set the voice for the native voice.
|
|
An optional close event.
|
|
Element id and class prefix.
|
|
Enable or disable speech.
|
|
The name of the voice to use.
|
|
The name of the voice mod to use.
|
|
Avatar image/video width.
|
Method Attributes | Method Name and Description |
---|---|
addMessage(message, emote, action, pose)
Add the message to the avatars message queue.
|
|
closeBox()
Close the embedding div in the current webpage.
|
|
Create an embedding bar and div in the current webpage.
|
|
message(message, emote, action, pose, afterFunction)
Have the avatar speak the message with voice and animation.
|
|
openBox()
Open the embedding div in the current webpage.
|
|
processMessages(pause)
Add the message to the avatars message queue.
|
|
updateAvatar(responseMessage, afterFunction)
Update the avatar's image/video/audio from the message response.
|
Class Detail
WebAvatar()
The WebAvatar provides access to an avatar and binds it to elements in an HTML document.
It lets you use a bot avatar without having a bot. You can tell the avatar what to say, and what actions and poses to display.
The HTML document requires the following elements:
- avatar - img element for the avatar
- avatar-image-div - div element for the avatar's image
- avatar-video - video element for the avatar's video
- avatar-video-div - div element for the avatar's video
Field Detail
avatar
The id or name of the avatar object to use.
background
Allow the background color to be set.
backgroundIfNotChrome
Only apply the background color if not Chrome.
closed
Return if the avatar box is in a closed state.
connection
An SDK connection object must be set.
ended
Function to invoke when processing all messages is complete.
format
Set if the avatar should request a specific video or image format.
hd
Set if the avatar should request HD (high def) video/images.
height
Avatar image/video height.
lang
Set the language for the native voice.
messages
Store list of messages to output.
nativeVoice
Configure if the browser's native voice TTS should be used.
nativeVoiceName
Set the voice for the native voice.
onclose
An optional close event.
prefix
Element id and class prefix. Can be used to have multiple avatars in the same page, or avoid naming collisions.
speak
Enable or disable speech.
voice
The name of the voice to use.
voiceMod
The name of the voice mod to use.
width
Avatar image/video width.
Method Detail
addMessage(message, emote, action, pose)
Add the message to the avatars message queue.
The messages will be spoken when processMessages() is called.
- Parameters:
- message
- emote
- action
- pose
closeBox()
Close the embedding div in the current webpage.
createBox()
Create an embedding bar and div in the current webpage.
message(message, emote, action, pose, afterFunction)
Have the avatar speak the message with voice and animation.
The function will be called at the end of the speech.
- Parameters:
- message
- emote
- action
- pose
- afterFunction
openBox()
Open the embedding div in the current webpage.
processMessages(pause)
Add the message to the avatars message queue.
The messages will be spoken when runMessages() is called.
- Parameters:
- pause
updateAvatar(responseMessage, afterFunction)
Update the avatar's image/video/audio from the message response.
- Parameters:
- responseMessage
- afterFunction