Discussions
Concurrent sessions in SDK - streaming avatar
12 days ago by becca
I'm trying to implement the streaming avatar using the sdk in Javascript. Currently, I have a problem with the StreamingEvents.STREAM_DISCONNECTED event listener constantly creating new threads of the avatar. This is what I have:
avatarRef.current.on(StreamingEvents.STREAM_DISCONNECTED, () => {
//if the avatar is not idle, attempt to restart the avatar
if (!isAvatarIdle) {
startSession();
handleStream();
}
});
I need this code in place because otherwise it stops in the middle of talking.
What is a better way to implement this?