From f230b4e5a05f70882a759358c4f8ca540f6c1d39 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Wed, 16 Oct 2024 20:41:18 +0200 Subject: [PATCH] [mirotalksfu] - avatars improvements --- app/src/config.template.js | 2 +- public/js/RoomClient.js | 9 +++++---- public/views/Room.html | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/app/src/config.template.js b/app/src/config.template.js index 53174f3a..be025fa3 100644 --- a/app/src/config.template.js +++ b/app/src/config.template.js @@ -234,7 +234,7 @@ module.exports = { basePath: 'https://api.heygen.com', apiKey: '', systemLimit: - 'You are a streaming avatar from MiroTalk SFU, an industry-leading product that specialize in videos communications. Audience will try to have a conversation with you, please try answer the questions or respond their comments naturally, and concisely. - please try your best to response with short answers, and only answer the last question.', + 'You are a streaming avatar from MiroTalk SFU, an industry-leading product that specialize in videos communications.', }, email: { /* diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 0a2b4c4e..d63f7f6d 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -3003,7 +3003,7 @@ class RoomClient { } } - msgPopup(type, message) { + msgPopup(type, message, timer = 3000) { switch (type) { case 'warning': case 'error': @@ -3048,7 +3048,7 @@ class RoomClient { showConfirmButton: false, timerProgressBar: true, toast: true, - timer: 3000, + timer: timer, }); Toast.fire({ icon: 'info', @@ -7853,6 +7853,7 @@ class RoomClient { // ############################################## getAvatarList() { + this.msgPopup('toast', 'Please hold on, we are processing the avatar lists...', 10000); this.socket .request('getAvatarList') .then(function (completion) { @@ -7885,7 +7886,7 @@ class RoomClient { 'default', ]; - console.log('AVATARS LISTS', completion.response.avatars); + //console.log('AVATARS LISTS', completion.response.avatars); completion.response.avatars.forEach((avatar) => { avatar.avatar_states.forEach((avatarUi) => { if ( @@ -7994,7 +7995,7 @@ class RoomClient { const selectedPreviewURL = completion.response.list.find( (flag) => flag.voice_id === selectedVoiceID, )?.preview?.movio; - VideoAI.avatarVoice = selectedVoiceID; + VideoAI.avatarVoice = selectedVoiceID ? selectedVoiceID : null; if (selectedPreviewURL) { const avatarPreviewAudio = document.getElementById('avatarPreviewAudio'); avatarPreviewAudio.src = selectedPreviewURL; diff --git a/public/views/Room.html b/public/views/Room.html index 3bff7e18..7e3a3fe9 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -937,7 +937,7 @@ access to use this app.
- +