From 74a05fbdde5449211aa73dd6b96357babcd8e6fe Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 13 Apr 2020 19:07:12 +0200 Subject: [PATCH] Add a notice when recording --- assets/css/components/calls/window.css | 11 +++++++++++ assets/js/components/calls/window.js | 19 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/assets/css/components/calls/window.css b/assets/css/components/calls/window.css index 020bad12..6e51d8c5 100644 --- a/assets/css/components/calls/window.css +++ b/assets/css/components/calls/window.css @@ -64,6 +64,17 @@ color: inherit; } +.call-window .head .record-label { + color: red; + margin-left: 10px; +} + +.call-window .head .record-label a { + margin-left: 5px; + background-color: darkred !important; + font-weight: bold; +} + .call-window .members-area { color: white; font-size: 80%; diff --git a/assets/js/components/calls/window.js b/assets/js/components/calls/window.js index 4f80e62b..70e0fbf6 100644 --- a/assets/js/components/calls/window.js +++ b/assets/js/components/calls/window.js @@ -923,6 +923,22 @@ class CallWindow extends CustomEvents { this.recorder = new MultiStreamRecorder(streams); this.recorder.ondataavailable = onDataAvailable this.recorder.start(30*60*1000); // Ask for save every 30min + + + // Add notice + this.recordLabel = createElem2({ + appendTo: this.windowHead, + type: "span", + class: "record-label", + innerHTML: "Recording" + }); + + createElem2({ + appendTo: this.recordLabel, + type: "a", + innerHTML: "STOP", + onclick: () => this.startRecording() + }) } @@ -930,6 +946,9 @@ class CallWindow extends CustomEvents { else { this.recorder.stop(onDataAvailable) delete this.recorder + + // Remove notice + this.recordLabel.remove() } } } \ No newline at end of file