[mirotalksfu] - add start all transcriptions

هذا الالتزام موجود في:
Miroslav Pejic
2024-12-17 23:30:08 +01:00
الأصل 9c8df9b7fa
التزام 0ea60388ea
8 ملفات معدلة مع 81 إضافات و10 حذوفات

عرض الملف

@@ -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;