Skip to content

Commit

Permalink
[mirotalksfu] - improvements, update dep
Browse files Browse the repository at this point in the history
  • Loading branch information
miroslavpejic85 committed May 31, 2024
1 parent 2859818 commit 78fff65
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 18 deletions.
2 changes: 1 addition & 1 deletion app/src/Server.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependencies: {
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.41
* @version 1.4.42
*
*/

Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "mirotalksfu",
"version": "1.4.41",
"version": "1.4.42",
"description": "WebRTC SFU browser-based video calls",
"main": "Server.js",
"scripts": {
Expand Down Expand Up @@ -67,7 +67,7 @@
},
"devDependencies": {
"node-fetch": "^3.3.2",
"nodemon": "^3.1.1",
"nodemon": "^3.1.2",
"prettier": "3.2.5"
}
}
5 changes: 5 additions & 0 deletions public/css/Room.css
Original file line number Diff line number Diff line change
Expand Up @@ -1333,6 +1333,11 @@ hr {
align-items: center; /* Center vertically */
}

.container-flex {
display: flex;
flex-direction: column;
}

/* Custom avatar audio UI */

#audio-container {
Expand Down
5 changes: 4 additions & 1 deletion public/js/Room.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (location.href.substr(0, 5) !== 'https') location.href = 'https' + location.h
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.41
* @version 1.4.42
*
*/

Expand Down Expand Up @@ -1460,6 +1460,9 @@ function handleButtons() {
showFreeAvatars = e.currentTarget.checked;
rc.getAvatarList();
};
avatarQuality.onchange = (e) => {
VideoAI.quality = e.target.value;
};
refreshVideoDevices.onclick = async () => {
await refreshMyVideoDevices();
userLog('info', 'Refreshed video devices', 'top-end');
Expand Down
18 changes: 12 additions & 6 deletions public/js/RoomClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
* @license For commercial or closed source, contact us at [email protected] or purchase directly via CodeCanyon
* @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970
* @author Miroslav Pejic - [email protected]
* @version 1.4.41
* @version 1.4.42
*
*/

Expand Down Expand Up @@ -3852,11 +3852,13 @@ class RoomClient {
? `<span class="message-data-time">${time}, ${getFromName} ( me ) </span>`
: `<span class="message-data-time">${time}, ${getFromName} </span>`;

const formatMessage = this.formatMsg(getMsg);
console.log('FormatMessage', formatMessage);
const speechButton = this.isSpeechSynthesisSupported
? `<button
id="msg-speech-${chatMessagesId}"
class="mr5"
onclick="rc.speechMessage(false, '${getFromName}', '${this.formatMsg(getMsg)}')">
onclick="rc.speechText('${formatMessage}')">
<i class="fas fa-volume-high"></i>
</button>`
: '';
Expand Down Expand Up @@ -4097,10 +4099,14 @@ class RoomClient {
}

speechText(msg) {
const speech = new SpeechSynthesisUtterance();
speech.text = msg;
speech.rate = 0.9;
window.speechSynthesis.speak(speech);
if (VideoAI.active) {
this.streamingTask(msg);
} else {
const speech = new SpeechSynthesisUtterance();
speech.text = msg;
speech.rate = 0.9;
window.speechSynthesis.speak(speech);
}
}

chatToggleBg() {
Expand Down
27 changes: 19 additions & 8 deletions public/views/Room.html
Original file line number Diff line number Diff line change
Expand Up @@ -884,6 +884,7 @@ <h1>Loading</h1>
<div id="tabVideoAI" class="tabcontent">
<div class="avatarsVideoAI">
<video id="avatarVideoAIPreview" src="" controls="yes"></video>
<hr />
<table class="settingsTable">
<tr id="avatars">
<td class=".width-180">
Expand All @@ -904,19 +905,29 @@ <h1>Loading</h1>
</td>
</tr>
</table>
<div id="avatarVideoAIcontainer"></div>
<div>
<select id="avatarVoiceIDs" name="avatarVoiceIDs">
<hr />
<div class="container-flex">
<div id="avatarVideoAIcontainer"></div>
<select id="avatarQuality" class="form-select text-light bg-dark">
<option value="low">Avatar Quality - Low</option>
<option value="medium" selected>Avatar Quality - Medium</option>
<option value="hight">Avatar Quality - Hight</option>
</select>
<select
id="avatarVoiceIDs"
name="avatarVoiceIDs"
class="form-select text-light bg-dark"
>
<option value="">Select Avatar Voice</option></select
><br /><br />
><br />
<div id="audio-container">
<audio id="avatarPreviewAudio" controls></audio>
</div>
<br />
<button id="avatarVideoAIStart" class="btn-primary">
<i class="fas fa-play"></i> Start Avatar Session
</button>
</div>
<br />
<button id="avatarVideoAIStart" class="btn-primary">
<i class="fas fa-play"></i> Start Video Avatar Session
</button>
</div>
</div>

Expand Down

0 comments on commit 78fff65

Please sign in to comment.