[mirotalksfu] - save recording on disconnect

هذا الالتزام موجود في:
Miroslav Pejic
2023-12-22 17:05:55 +01:00
الأصل 9f823ac60a
التزام 2b91efd182
2 ملفات معدلة مع 28 إضافات و17 حذوفات

عرض الملف

@@ -1342,6 +1342,9 @@ function handleButtons() {
isRecording ? stopRecButton.click() : startRecButton.click();
};
startRecButton.onclick = () => {
if (participantsCount == 1 && !rc.peer_info.peer_audio) {
return userLog('warning', '🔴 Recording requires your audio to be enabled', 'top-end', 6000);
}
rc.startRecording();
};
stopRecButton.onclick = () => {
@@ -2289,8 +2292,7 @@ function handleRoomClientEvents() {
console.log('Room event: host only recording enabled');
// Stop recording ...
if (rc.isRecording() || recordingStatus.innerText != '0s') {
console.log('Room event: host only recording enabled, going to stop recording');
rc.stopRecording();
rc.saveRecording('Room event: host only recording enabled, going to stop recording');
}
hide(startRecButton);
hide(roomRecording);
@@ -2314,8 +2316,7 @@ function handleRoomClientEvents() {
rc.on(RoomClient.EVENTS.exitRoom, () => {
console.log('Room event: Client leave room');
if (rc.isRecording() || recordingStatus.innerText != '0s') {
console.log('Room event: Client save recording before to exit');
rc.stopRecording();
rc.saveRecording('Room event: Client save recording before to exit');
}
if (survey && survey.enabled) {
leaveFeedback();

عرض الملف

@@ -860,6 +860,7 @@ class RoomClient {
function () {
this.exit(true);
this.ServerAway();
this.saveRecording('Socket disconnected');
}.bind(this),
);
}
@@ -4051,19 +4052,21 @@ class RoomClient {
lastRecordingInfo.innerHTML = `Last Recording Info: ${recordingInfo}`;
show(lastRecordingInfo);
Swal.fire({
background: swalBackground,
position: 'center',
icon: 'success',
title: 'Recording',
html: `<div style="text-align: left;">
🔴 Recording Info:
${recordingInfo}
Please wait to be processed, then will be downloaded to your ${currentDevice} device.
</div>`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
});
if (window.localStorage.isReconnected === 'false') {
Swal.fire({
background: swalBackground,
position: 'center',
icon: 'success',
title: 'Recording',
html: `<div style="text-align: left;">
🔴 Recording Info:
${recordingInfo}
Please wait to be processed, then will be downloaded to your ${currentDevice} device.
</div>`,
showClass: { popup: 'animate__animated animate__fadeInDown' },
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
});
}
console.log('MediaRecorder Download Blobs');
const url = window.URL.createObjectURL(blob);
@@ -4159,6 +4162,13 @@ class RoomClient {
);
}
saveRecording(reason) {
if (this._isRecording || recordingStatus.innerText != '0s') {
console.log(`Save recording: ${reason}`);
this.stopRecording();
}
}
// ####################################################
// FILE SHARING
// ####################################################