[mirotalksfu] - save recording on disconnect
هذا الالتزام موجود في:
@@ -1342,6 +1342,9 @@ function handleButtons() {
|
|||||||
isRecording ? stopRecButton.click() : startRecButton.click();
|
isRecording ? stopRecButton.click() : startRecButton.click();
|
||||||
};
|
};
|
||||||
startRecButton.onclick = () => {
|
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();
|
rc.startRecording();
|
||||||
};
|
};
|
||||||
stopRecButton.onclick = () => {
|
stopRecButton.onclick = () => {
|
||||||
@@ -2289,8 +2292,7 @@ function handleRoomClientEvents() {
|
|||||||
console.log('Room event: host only recording enabled');
|
console.log('Room event: host only recording enabled');
|
||||||
// Stop recording ...
|
// Stop recording ...
|
||||||
if (rc.isRecording() || recordingStatus.innerText != '0s') {
|
if (rc.isRecording() || recordingStatus.innerText != '0s') {
|
||||||
console.log('Room event: host only recording enabled, going to stop recording');
|
rc.saveRecording('Room event: host only recording enabled, going to stop recording');
|
||||||
rc.stopRecording();
|
|
||||||
}
|
}
|
||||||
hide(startRecButton);
|
hide(startRecButton);
|
||||||
hide(roomRecording);
|
hide(roomRecording);
|
||||||
@@ -2314,8 +2316,7 @@ function handleRoomClientEvents() {
|
|||||||
rc.on(RoomClient.EVENTS.exitRoom, () => {
|
rc.on(RoomClient.EVENTS.exitRoom, () => {
|
||||||
console.log('Room event: Client leave room');
|
console.log('Room event: Client leave room');
|
||||||
if (rc.isRecording() || recordingStatus.innerText != '0s') {
|
if (rc.isRecording() || recordingStatus.innerText != '0s') {
|
||||||
console.log('Room event: Client save recording before to exit');
|
rc.saveRecording('Room event: Client save recording before to exit');
|
||||||
rc.stopRecording();
|
|
||||||
}
|
}
|
||||||
if (survey && survey.enabled) {
|
if (survey && survey.enabled) {
|
||||||
leaveFeedback();
|
leaveFeedback();
|
||||||
|
|||||||
@@ -860,6 +860,7 @@ class RoomClient {
|
|||||||
function () {
|
function () {
|
||||||
this.exit(true);
|
this.exit(true);
|
||||||
this.ServerAway();
|
this.ServerAway();
|
||||||
|
this.saveRecording('Socket disconnected');
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -4051,19 +4052,21 @@ class RoomClient {
|
|||||||
lastRecordingInfo.innerHTML = `Last Recording Info: ${recordingInfo}`;
|
lastRecordingInfo.innerHTML = `Last Recording Info: ${recordingInfo}`;
|
||||||
show(lastRecordingInfo);
|
show(lastRecordingInfo);
|
||||||
|
|
||||||
Swal.fire({
|
if (window.localStorage.isReconnected === 'false') {
|
||||||
background: swalBackground,
|
Swal.fire({
|
||||||
position: 'center',
|
background: swalBackground,
|
||||||
icon: 'success',
|
position: 'center',
|
||||||
title: 'Recording',
|
icon: 'success',
|
||||||
html: `<div style="text-align: left;">
|
title: 'Recording',
|
||||||
🔴 Recording Info:
|
html: `<div style="text-align: left;">
|
||||||
${recordingInfo}
|
🔴 Recording Info:
|
||||||
Please wait to be processed, then will be downloaded to your ${currentDevice} device.
|
${recordingInfo}
|
||||||
</div>`,
|
Please wait to be processed, then will be downloaded to your ${currentDevice} device.
|
||||||
showClass: { popup: 'animate__animated animate__fadeInDown' },
|
</div>`,
|
||||||
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
|
showClass: { popup: 'animate__animated animate__fadeInDown' },
|
||||||
});
|
hideClass: { popup: 'animate__animated animate__fadeOutUp' },
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
console.log('MediaRecorder Download Blobs');
|
console.log('MediaRecorder Download Blobs');
|
||||||
const url = window.URL.createObjectURL(blob);
|
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
|
// FILE SHARING
|
||||||
// ####################################################
|
// ####################################################
|
||||||
|
|||||||
المرجع في مشكلة جديدة
حظر مستخدم