Start client capture for auto-record and silence false empty alerts.
Deploy Ladill Meet / deploy (push) Successful in 32s
Deploy Ladill Meet / deploy (push) Successful in 32s
Server-side auto-record now triggers browser MediaRecorder on connect, and the end-meeting dialog only warns when capture actually ran but produced no file. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -168,6 +168,7 @@ function meetRoom() {
|
|||||||
this.muteOnJoin = el.dataset.muteOnJoin === '1';
|
this.muteOnJoin = el.dataset.muteOnJoin === '1';
|
||||||
this.videoOffOnJoin = el.dataset.videoOffOnJoin === '1' || this.audioOnly;
|
this.videoOffOnJoin = el.dataset.videoOffOnJoin === '1' || this.audioOnly;
|
||||||
this.isRecording = el.dataset.recordingActive === '1';
|
this.isRecording = el.dataset.recordingActive === '1';
|
||||||
|
this.activeRecordingUuid = el.dataset.activeRecordingUuid || null;
|
||||||
this.isLocked = el.dataset.locked === '1';
|
this.isLocked = el.dataset.locked === '1';
|
||||||
this.watermark = el.dataset.watermark === '1';
|
this.watermark = el.dataset.watermark === '1';
|
||||||
this.liveCaptions = el.dataset.liveCaptions === '1';
|
this.liveCaptions = el.dataset.liveCaptions === '1';
|
||||||
@@ -371,6 +372,8 @@ function meetRoom() {
|
|||||||
this.attachExistingTracks(room.localParticipant);
|
this.attachExistingTracks(room.localParticipant);
|
||||||
room.remoteParticipants.forEach((participant) => this.attachExistingTracks(participant));
|
room.remoteParticipants.forEach((participant) => this.attachExistingTracks(participant));
|
||||||
this.syncParticipants();
|
this.syncParticipants();
|
||||||
|
|
||||||
|
await this.maybeStartAutoRecording();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error(e);
|
console.error(e);
|
||||||
this.connectionStatus = this.connectionErrorMessage(e);
|
this.connectionStatus = this.connectionErrorMessage(e);
|
||||||
@@ -1359,6 +1362,37 @@ function meetRoom() {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
async maybeStartAutoRecording() {
|
||||||
|
if (!this.isHost || !this.isRecording || recordingMediaRecorder) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const el = document.getElementById('meet-config');
|
||||||
|
const existingUuid = this.activeRecordingUuid || el?.dataset.activeRecordingUuid || '';
|
||||||
|
|
||||||
|
if (existingUuid) {
|
||||||
|
this.activeRecordingUuid = existingUuid;
|
||||||
|
} else {
|
||||||
|
await this.startServerRecording();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
const started = await this.tryStartClientRecordingWithRetry();
|
||||||
|
if (!started) {
|
||||||
|
console.warn('Auto-record client capture could not start.');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async tryStartClientRecordingWithRetry() {
|
||||||
|
if (this.startClientRecording()) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
await new Promise((resolve) => setTimeout(resolve, 1500));
|
||||||
|
|
||||||
|
return this.startClientRecording();
|
||||||
|
},
|
||||||
|
|
||||||
async toggleRecording() {
|
async toggleRecording() {
|
||||||
if (!this.isHost) return;
|
if (!this.isHost) return;
|
||||||
|
|
||||||
@@ -1375,7 +1409,7 @@ function meetRoom() {
|
|||||||
|
|
||||||
const data = await res.json();
|
const data = await res.json();
|
||||||
this.activeRecordingUuid = data.recording_uuid;
|
this.activeRecordingUuid = data.recording_uuid;
|
||||||
if (!this.startClientRecording()) {
|
if (! await this.tryStartClientRecordingWithRetry()) {
|
||||||
this.isRecording = false;
|
this.isRecording = false;
|
||||||
this.activeRecordingUuid = null;
|
this.activeRecordingUuid = null;
|
||||||
return;
|
return;
|
||||||
@@ -1453,6 +1487,7 @@ function meetRoom() {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async stopServerAndUploadRecording() {
|
async stopServerAndUploadRecording() {
|
||||||
|
const hadClientRecorder = !!recordingMediaRecorder;
|
||||||
const res = await fetch(this.config.recordingStopUrl, { method: 'POST', headers: this.headers() });
|
const res = await fetch(this.config.recordingStopUrl, { method: 'POST', headers: this.headers() });
|
||||||
const blob = await this.stopClientRecording();
|
const blob = await this.stopClientRecording();
|
||||||
this.isRecording = false;
|
this.isRecording = false;
|
||||||
@@ -1470,7 +1505,7 @@ function meetRoom() {
|
|||||||
if (!uploaded) {
|
if (!uploaded) {
|
||||||
window.alert(`Recording upload failed. Open Recordings and try again, or re-record the ${this.sessionNoun()}.`);
|
window.alert(`Recording upload failed. Open Recordings and try again, or re-record the ${this.sessionNoun()}.`);
|
||||||
}
|
}
|
||||||
} else if (recordingUuid) {
|
} else if (recordingUuid && hadClientRecorder) {
|
||||||
window.alert(`No recording was captured from this ${this.sessionNoun()}. Start recording again while the ${this.sessionNoun()} is live.`);
|
window.alert(`No recording was captured from this ${this.sessionNoun()}. Start recording again while the ${this.sessionNoun()} is live.`);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,6 +90,7 @@
|
|||||||
data-watermark="{{ $watermark ? '1' : '0' }}"
|
data-watermark="{{ $watermark ? '1' : '0' }}"
|
||||||
data-locked="{{ $session->is_locked ? '1' : '0' }}"
|
data-locked="{{ $session->is_locked ? '1' : '0' }}"
|
||||||
data-recording-active="{{ $activeRecording ? '1' : '0' }}"
|
data-recording-active="{{ $activeRecording ? '1' : '0' }}"
|
||||||
|
data-active-recording-uuid="{{ $activeRecording?->uuid ?? '' }}"
|
||||||
data-is-webinar="{{ ($isWebinar ?? false) ? '1' : '0' }}"
|
data-is-webinar="{{ ($isWebinar ?? false) ? '1' : '0' }}"
|
||||||
data-is-conference="{{ ($isConference ?? false) ? '1' : '0' }}"
|
data-is-conference="{{ ($isConference ?? false) ? '1' : '0' }}"
|
||||||
data-session-noun="{{ $sessionNoun }}"
|
data-session-noun="{{ $sessionNoun }}"
|
||||||
|
|||||||
Reference in New Issue
Block a user