Hosted Experience

Methods

32min
once you've created an instance of uneeq, you can interact with it to control behaviour dynamically the below methods are available on your uneeq instance (e g uneeqinstance you can learn more about uneeq options configuration options docid\ sdhjkgdonb9libvmfh s4 const uneeqinstance = new uneeq(options) // now you can call methods on uneeqinstance, e g // uneeqinstance cameraanchorhorizontal('center', 500) methods init() initializes the uneeq instance by validating options and setting up the message event handler uneeqinstance init() cameraanchorhorizontal(position, duration) requests the camera to move to a specified anchor position parameters position (string) the desired camera anchor position 'left' | 'right' | 'center' | 'close up' | 'loose close up' | 'tight medium shot' | 'medium shot' | 'medium full shot' | 'full shot' duration (number) the duration for the camera movement in milliseconds uneeqinstance cameraanchorhorizontal('right', 500); cameraanchordistance(position, duration) requests the camera to move to a specified anchor position parameters position (string) the desired camera anchor position 'close up' | 'loose close up' | 'tight medium shot' | 'medium shot' | 'medium full shot' | 'full shot' duration (number) the duration for the camera movement in milliseconds uneeqinstance cameraanchordistance('close up', 500); chatprompt(prompt, addclosedcaption) sends a chat prompt to the digital human parameters prompt (string) the chat prompt message addclosedcaption (boolean) should the prompt message be added to the closed captions default false uneeqinstance chatprompt('hello, how are you?', true); speak(speech) sends a speak request to the digital human this will interrupt any speech that is in progress sending multiple/overlapping speak requests will not result in those requests being queued parameters speech (string) the text to be spoken by the digital human uneeqinstance speak('welcome to our service '); enablemicrophone() enables the user's microphone for audio recording uneeqinstance enablemicrophone(); endsession() ends the current session uneeqinstance endsession(); pausespeechrecognition() pauses speech recognition processing this is equivilent to muting the users microphone uneeqinstance pausespeechrecognition(); resumespeechrecognition() resumes speech recognition processing this is equivilent to un muting the users microphone uneeqinstance resumespeechrecognition(); setcustompromptmetadata(custommetadata) sets custom metadata for chat prompts parameters custommetadata (object) the custom metadata for chat uneeqinstance setcustompromptmetadata({"key" "value"}); uneeqinstance setcustompromptmetadata({"name" "john"}) setlayoutmode(layoutmode) sets the layout mode of the interface parameters layoutmode (string) 'overlay' | 'fullscreen' | 'contained' uneeqinstance setlayoutmode('fullscreen'); setwebrtcstatsenabled(enablemessages boolean, enablelogs boolean) to diagnose video or audio quality issues, you can turn on (or off) webrtc logging enablelogs to have them output to the browsers console if you want to programatically handle these messages you can enablemessages to have them passed through to your page for handling when enablemessages is enabled your page will receive a message with the key/value pair uneeqmessagetype "webrtcstats" uneeqinstance setwebrtcstatsenabled(true, true); stopspeaking() instructs the digital human to stop speaking uneeqinstance stopspeaking(); unmutedigitalhuman() unmutes the digital human if the browser has muted it due to auto play policy uneeqinstance unmutedigitalhuman(); mutedigitalhuman() mutes the digital human you must call unmutedigitalhuman() to receive audio again there is no on screen indicator of this muted state uneeqinstance mutedigitalhuman(); updatedisplaycontent(htmlcontent) sets html content to be displayed in the content window parameters htmlcontent (string) the html content to display uneeqinstance updatedisplaycontent('\<p>new content\</p>'); setshowclosedcaptions(show) sets whether closed captions are displayed parameters show (boolean) true to show closed captions, false otherwise uneeqinstance setshowclosedcaptions(true); setshowuserinputinterface(show) sets whether the user input interface (text/voice input ui) is displayed parameters show (boolean) true to show the user input interface, false otherwise uneeqinstance setshowuserinputinterface(true); startsession() starts a session with the digital human uneeqinstance startsession();