1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-04 06:45:45 +02:00

recording: show message when peer starts / stops recording the call

Gitlab: #160

Change-Id: Id8125c56145cc661941f445c2f52b73fd983c97d
This commit is contained in:
ababi 2020-12-17 12:40:08 +01:00 committed by Albert Babí Oller
parent d31c7bc549
commit 08236cf5e7
7 changed files with 94 additions and 21 deletions

View file

@ -469,6 +469,29 @@ CallAdapter::connectCallModel(const QString& accountId)
emit LRCInstance::instance().updateSmartList(); emit LRCInstance::instance().updateSmartList();
}); });
remoteRecordingChangedConnection_ = QObject::connect(
accInfo.callModel.get(),
&lrc::api::NewCallModel::remoteRecordingChanged,
[this](const QString& callId, const QSet<QString>& peerRec, bool state) {
const auto currentCallId =
LRCInstance::getCallIdForConversationUid(convUid_, accountId_);
if (callId == currentCallId) {
const auto& accInfo = LRCInstance::getCurrentAccountInfo();
QStringList peers {};
for (const auto& uri: peerRec) {
auto bestName = accInfo.contactModel->bestNameForContact(uri);
if (!bestName.isEmpty()) {
peers.append(bestName);
}
}
if (!peers.isEmpty()) {
emit remoteRecordingChanged(peers, true);
} else if (!state) {
emit remoteRecordingChanged(peers, false);
}
}
});
} }
void void

View file

@ -96,6 +96,7 @@ signals:
bool isSIP, bool isSIP,
bool isConferenceCall, bool isConferenceCall,
const QString& bestName); const QString& bestName);
void remoteRecordingChanged(const QStringList& peers, bool state);
public slots: public slots:
void slotShowIncomingCallView(const QString& accountId, void slotShowIncomingCallView(const QString& accountId,
@ -117,6 +118,7 @@ private:
QMetaObject::Connection onParticipantsChangedConnection_; QMetaObject::Connection onParticipantsChangedConnection_;
QMetaObject::Connection closeIncomingCallPageConnection_; QMetaObject::Connection closeIncomingCallPageConnection_;
QMetaObject::Connection appStateChangedConnection_; QMetaObject::Connection appStateChangedConnection_;
QMetaObject::Connection remoteRecordingChangedConnection_;
/* /*
* For Call Overlay * For Call Overlay

View file

@ -174,6 +174,11 @@ Item {
property string name: qsTr("name") property string name: qsTr("name")
property string identifier: qsTr("Identifier") property string identifier: qsTr("Identifier")
// CallOverlay
property string isRecording: qsTr("is recording")
property string areRecording: qsTr("are recording")
property string peerStoppedRecording: qsTr("Peer stopped recording")
// CallOverlayButtonGroup // CallOverlayButtonGroup
property string mute: qsTr("Mute") property string mute: qsTr("Mute")
property string unmute: qsTr("Unmute") property string unmute: qsTr("Unmute")

View file

@ -36,15 +36,17 @@ Rectangle {
id: callOverlayRect id: callOverlayRect
property string timeText: "00:00" property string timeText: "00:00"
property string remoteRecordingLabel: ""
signal overlayChatButtonClicked
property var participantOverlays: [] property var participantOverlays: []
property var participantComponent: Qt.createComponent("ParticipantOverlay.qml") property var participantComponent: Qt.createComponent("ParticipantOverlay.qml")
function setRecording(isRecording) { signal overlayChatButtonClicked
callViewContextMenu.isRecording = isRecording
recordingRect.visible = isRecording function setRecording(localIsRecording) {
callViewContextMenu.localIsRecording = localIsRecording
recordingRect.visible = localIsRecording
|| callViewContextMenu.peerIsRecording
} }
function updateButtonStatus(isPaused, isAudioOnly, isAudioMuted, isVideoMuted, function updateButtonStatus(isPaused, isAudioOnly, isAudioMuted, isVideoMuted,
@ -52,12 +54,11 @@ Rectangle {
callViewContextMenu.isSIP = isSIP callViewContextMenu.isSIP = isSIP
callViewContextMenu.isPaused = isPaused callViewContextMenu.isPaused = isPaused
callViewContextMenu.isAudioOnly = isAudioOnly callViewContextMenu.isAudioOnly = isAudioOnly
callViewContextMenu.isRecording = isRecording callViewContextMenu.localIsRecording = isRecording
recordingRect.visible = isRecording recordingRect.visible = isRecording
callOverlayButtonGroup.setButtonStatus(isPaused, isAudioOnly, callOverlayButtonGroup.setButtonStatus(isPaused, isAudioOnly,
isAudioMuted, isVideoMuted, isAudioMuted, isVideoMuted,
isRecording, isSIP, isSIP, isConferenceCall)
isConferenceCall)
} }
function updateMenu() { function updateMenu() {
@ -91,7 +92,6 @@ Rectangle {
&& pW >= distantRenderer.width - distantRenderer.getXOffset() * 2 - 1) && pW >= distantRenderer.width - distantRenderer.getXOffset() * 2 - 1)
} }
function handleParticipantsInfo(infos) { function handleParticipantsInfo(infos) {
// TODO: in the future the conference layout should be entirely managed by the client // TODO: in the future the conference layout should be entirely managed by the client
videoCallOverlay.updateMenu() videoCallOverlay.updateMenu()
@ -185,7 +185,6 @@ Rectangle {
} }
} }
} }
} }
// x, y position does not need to be translated // x, y position does not need to be translated
@ -196,6 +195,27 @@ Rectangle {
callViewContextMenu.openMenu() callViewContextMenu.openMenu()
} }
function showRemoteRecording(peers, state) {
var label = ""
var i = 0
if (state) {
for (var p in peers) {
label += peers[p]
if (i !== (peers.length - 1))
label += ", "
i += 1
}
label += " " + ((peers.length > 1)? JamiStrings.areRecording
: JamiStrings.isRecording)
}
remoteRecordingLabel = state? label : JamiStrings.peerStoppedRecording
callViewContextMenu.peerIsRecording = state
recordingRect.visible = callViewContextMenu.localIsRecording
|| callViewContextMenu.peerIsRecording
callOverlayRectMouseArea.entered()
}
anchors.fill: parent anchors.fill: parent
SipInputPanel { SipInputPanel {
@ -212,13 +232,26 @@ Rectangle {
onTriggered: { onTriggered: {
if (overlayUpperPartRect.state !== 'freezed') { if (overlayUpperPartRect.state !== 'freezed') {
overlayUpperPartRect.state = 'freezed' overlayUpperPartRect.state = 'freezed'
resetRecordingLabelTimer.restart()
} }
if (callOverlayButtonGroup.state !== 'freezed') { if (callOverlayButtonGroup.state !== 'freezed') {
callOverlayButtonGroup.state = 'freezed' callOverlayButtonGroup.state = 'freezed'
resetRecordingLabelTimer.restart()
} }
} }
} }
// Timer to reset recording label text
Timer {
id: resetRecordingLabelTimer
interval: 1000
onTriggered: {
if (callOverlayButtonGroup.state === 'freezed'
&& !callViewContextMenu.peerIsRecording)
remoteRecordingLabel = ""
}
}
Rectangle { Rectangle {
id: overlayUpperPartRect id: overlayUpperPartRect
@ -287,8 +320,13 @@ Rectangle {
id: textMetricsjamiBestNameText id: textMetricsjamiBestNameText
font: jamiBestNameText.font font: jamiBestNameText.font
text: { text: {
if (videoCallPageRect) if (videoCallPageRect) {
if (remoteRecordingLabel === "") {
return videoCallPageRect.bestName return videoCallPageRect.bestName
} else {
return remoteRecordingLabel
}
}
return "" return ""
} }
elideWidth: overlayUpperPartRect.width / 3 elideWidth: overlayUpperPartRect.width / 3
@ -299,8 +337,11 @@ Rectangle {
Text { Text {
id: callTimerText id: callTimerText
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.preferredWidth: overlayUpperPartRect.width / 3 Layout.preferredWidth: 64
Layout.minimumWidth: 64
Layout.preferredHeight: 48 Layout.preferredHeight: 48
Layout.rightMargin: recordingRect.visible?
0 : JamiTheme.preferredMarginSize
font.pointSize: JamiTheme.textFontSize font.pointSize: JamiTheme.textFontSize
horizontalAlignment: Text.AlignRight horizontalAlignment: Text.AlignRight
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@ -310,7 +351,7 @@ Rectangle {
id: textMetricscallTimerText id: textMetricscallTimerText
font: callTimerText.font font: callTimerText.font
text: timeText text: timeText
elideWidth: overlayUpperPartRect.width / 3 elideWidth: overlayUpperPartRect.width / 4
elide: Qt.ElideRight elide: Qt.ElideRight
} }
} }
@ -318,6 +359,7 @@ Rectangle {
Rectangle { Rectangle {
id: recordingRect id: recordingRect
Layout.alignment: Qt.AlignVCenter | Qt.AlignRight Layout.alignment: Qt.AlignVCenter | Qt.AlignRight
Layout.rightMargin: JamiTheme.preferredMarginSize
height: 16 height: 16
width: 16 width: 16
radius: height / 2 radius: height / 2
@ -330,10 +372,6 @@ Rectangle {
ColorAnimation { from: "transparent"; to: "red"; duration: 500 } ColorAnimation { from: "transparent"; to: "red"; duration: 500 }
} }
} }
Item {
width: 8
}
} }
color: "transparent" color: "transparent"

View file

@ -45,7 +45,7 @@ Rectangle {
} }
function setButtonStatus(isPaused, isAudioOnly, isAudioMuted, isVideoMuted, function setButtonStatus(isPaused, isAudioOnly, isAudioMuted, isVideoMuted,
isRecording, isSIP, isConferenceCall) { isSIP, isConferenceCall) {
root.isModerator = CallAdapter.isCurrentModerator() root.isModerator = CallAdapter.isCurrentModerator()
root.isSip = isSIP root.isSip = isSIP
noVideoButton.visible = !isAudioOnly noVideoButton.visible = !isAudioOnly

View file

@ -37,7 +37,8 @@ Item {
property bool isSIP: false property bool isSIP: false
property bool isPaused: false property bool isPaused: false
property bool isAudioOnly: false property bool isAudioOnly: false
property bool isRecording: false property bool localIsRecording: false
property bool peerIsRecording: false
signal pluginItemClicked signal pluginItemClicked
signal transferCallButtonClicked signal transferCallButtonClicked
@ -67,7 +68,7 @@ Item {
ContextMenuGenerator.addMenuSeparator() ContextMenuGenerator.addMenuSeparator()
} }
ContextMenuGenerator.addMenuItem(isRecording ? JamiStrings.stopRec : ContextMenuGenerator.addMenuItem(localIsRecording ? JamiStrings.stopRec :
JamiStrings.startRec, JamiStrings.startRec,
"qrc:/images/icons/av_icons/fiber_manual_record-24px.svg", "qrc:/images/icons/av_icons/fiber_manual_record-24px.svg",
function (){ function (){

View file

@ -197,6 +197,10 @@ Rectangle {
function onShowOnHoldLabel(isPaused) { function onShowOnHoldLabel(isPaused) {
videoCallOverlay.showOnHoldImage(isPaused) videoCallOverlay.showOnHoldImage(isPaused)
} }
function onRemoteRecordingChanged(label, state) {
videoCallOverlay.showRemoteRecording(label, state)
}
} }
onOverlayChatButtonClicked: { onOverlayChatButtonClicked: {