From 0ea60388ea98457d3c9ec3fb3c6d259e46242633 Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Tue, 17 Dec 2024 23:30:08 +0100 Subject: [PATCH] [mirotalksfu] - add start all transcriptions --- app/src/Server.js | 2 +- package.json | 6 ++-- public/images/transcription.png | Bin 0 -> 2793 bytes public/js/Room.js | 5 ++- public/js/RoomClient.js | 6 +++- public/js/Rules.js | 1 + public/js/Transcription.js | 58 ++++++++++++++++++++++++++++++++ public/views/Room.html | 13 ++++--- 8 files changed, 81 insertions(+), 10 deletions(-) create mode 100644 public/images/transcription.png diff --git a/app/src/Server.js b/app/src/Server.js index 4efcbfc5..79880d38 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -55,7 +55,7 @@ dev dependencies: { * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.6.49 + * @version 1.6.50 * */ diff --git a/package.json b/package.json index 6583d3ce..201ccff9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.6.49", + "version": "1.6.50", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { @@ -58,7 +58,7 @@ }, "dependencies": { "@mattermost/client": "^10.2.0", - "@sentry/node": "^8.45.0", + "@sentry/node": "^8.46.0", "axios": "^1.7.9", "colors": "1.4.0", "compression": "1.7.5", @@ -78,7 +78,7 @@ "mediasoup-client": "3.7.18", "ngrok": "^5.0.0-beta.2", "nodemailer": "^6.9.16", - "openai": "^4.76.3", + "openai": "^4.77.0", "qs": "6.13.1", "socket.io": "4.8.1", "swagger-ui-express": "5.0.1", diff --git a/public/images/transcription.png b/public/images/transcription.png new file mode 100644 index 0000000000000000000000000000000000000000..a87f31a1866252b954017b2b6aa9326eb890c209 GIT binary patch literal 2793 zcmcIm`#;ldAOCI^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iIp6FX=p%wMFGPWdLXsKimUDWLP!U%U6E5K!ZG}1z(P9o`Q zW;thwvXdp443ENx!qdyLqsCdu!Z>Aq)S}u5COc(*5Zx=4DNJ*aRX!Eouw^CBR%h#Z z9xCniH%Ga6>lkt0smGXep?Y9wg7OD)SI57HHpKtVaG+s1zHR8K*gkAw^NZav)9IAE KLycWv;=cgEp(y { transcription.minimize(); }; + transcriptionAllBtn.onclick = () => { + transcription.startAll(); + }; transcriptionGhostBtn.onclick = () => { transcription.toggleBg(); }; diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 7453424f..83bfed22 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -9,7 +9,7 @@ * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.6.49 + * @version 1.6.50 * */ @@ -111,6 +111,7 @@ const image = { network: '../images/network.gif', rtmp: '../images/rtmp.png', save: '../images/save.png', + transcription: '../images/transcription.png', }; const mediaType = { @@ -7388,6 +7389,9 @@ class RoomClient { case 'roomEmoji': this.handleRoomEmoji(cmd); break; + case 'transcriptionAll': + this.transcription.handleTranscriptionAll(cmd); + break; case 'transcript': this.transcription.handleTranscript(cmd); break; diff --git a/public/js/Rules.js b/public/js/Rules.js index af29d7bb..8c41eb81 100644 --- a/public/js/Rules.js +++ b/public/js/Rules.js @@ -150,6 +150,7 @@ function handleRules(isPresenter) { BUTTONS.settings.sendEmailInvitation = true; show(editorUnlockBtn); + show(transcriptionAllLi); //... // ################################## diff --git a/public/js/Transcription.js b/public/js/Transcription.js index 7d816bab..4df3ba7b 100644 --- a/public/js/Transcription.js +++ b/public/js/Transcription.js @@ -415,6 +415,64 @@ class Transcription { }; } + handleTranscriptionAll(cmd) { + const { peer_name, transcriptionLanguageIndex, transcriptionDialectIndex } = cmd.data; + + if (!this.speechTranscription) { + hide(transcriptionFooter); + rc.msgPopup( + 'info', + `${peer_name} wants to start transcriptions for this session, but your browser does not support it. Please use a Chromium-based browser like Google Chrome, Microsoft Edge, or Brave.`, + ); + return; + } + + if (this.transcriptionRunning || !BUTTONS.main.transcriptionButton) return; + + Swal.fire({ + allowOutsideClick: false, + allowEscapeKey: false, + showDenyButton: true, + background: swalBackground, + position: 'center', + imageUrl: image.transcription, + title: 'Start Transcription', + text: `${peer_name} wants to start the transcriptions for this session. Would you like to enable them?`, + confirmButtonText: `Yes`, + denyButtonText: `No`, + showClass: { popup: 'animate__animated animate__fadeInDown' }, + hideClass: { popup: 'animate__animated animate__fadeOutUp' }, + }).then((result) => { + if (result.isConfirmed) { + if (this.isHidden) { + this.toggle(); + } + if (!this.transcriptionRunning) { + transcriptionLanguage.selectedIndex = transcriptionLanguageIndex; + this.updateCountry(); + transcriptionDialect.selectedIndex = transcriptionDialectIndex; + transcription.start(); + } + } + }); + } + + startAll() { + if (!this.transcriptionRunning) { + transcription.start(); + } + rc.emitCmd({ + type: 'transcriptionAll', + broadcast: true, + data: { + peer_id: rc.peer_id, + peer_name: rc.peer_name, + transcriptionLanguageIndex: transcriptionLanguage.selectedIndex, + transcriptionDialectIndex: transcriptionDialect.selectedIndex, + }, + }); + } + start() { try { this.transcriptionRunning = true; diff --git a/public/views/Room.html b/public/views/Room.html index a297b4f4..cb3e4772 100644 --- a/public/views/Room.html +++ b/public/views/Room.html @@ -1615,14 +1615,19 @@

Polls

  • +
  • +
  • - +
  • - +
  • @@ -1630,7 +1635,7 @@

    Polls

    -
    +