+
+ {clear ? null : (
+
+ )}
{clear ? '' : data}
From dc02150fbdc604055d4fed020c41a1621c47c48c Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 00:40:55 +0900
Subject: [PATCH 75/88] avatar
Create user/container.jsx
---
.../captions/live/user/container.jsx | 42 +++++++++++++++++++
1 file changed, 42 insertions(+)
create mode 100644 bigbluebutton-html5/imports/ui/components/captions/live/user/container.jsx
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/user/container.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/user/container.jsx
new file mode 100644
index 000000000000..8a4cbe1e03d4
--- /dev/null
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/user/container.jsx
@@ -0,0 +1,42 @@
+import React from 'react';
+import { withTracker } from 'meteor/react-meteor-data';
+import Users from '/imports/api/users';
+import User from './component';
+
+const MODERATOR = Meteor.settings.public.user.role_moderator;
+
+const Container = (props) =>
;
+
+const getUser = (userId) => {
+ const user = Users.findOne(
+ { userId },
+ {
+ fields: {
+ avatar: 1,
+ color: 1,
+ role: 1,
+ name: 1,
+ },
+ },
+ );
+
+ if (user) {
+ return {
+ avatar: user.avatar,
+ color: user.color,
+ moderator: user.role === MODERATOR,
+ name: user.name,
+ };
+ }
+
+ return {
+ avatar: '',
+ color: '',
+ moderator: false,
+ name: '',
+ };
+};
+
+export default withTracker(({ userId }) => {
+ return getUser(userId);
+})(Container);
From dbc9f839e995e42c85870e8da9722ff4551f9461 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 00:41:44 +0900
Subject: [PATCH 76/88] avatar
Create user/component.jsx
---
.../captions/live/user/component.jsx | 39 +++++++++++++++++++
1 file changed, 39 insertions(+)
create mode 100644 bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
new file mode 100644
index 000000000000..1fb3d2beee6a
--- /dev/null
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
@@ -0,0 +1,39 @@
+import React from 'react';
+import PropTypes from 'prop-types';
+import UserAvatar from '/imports/ui/components/user-avatar/component';
+
+const User = ({
+ avatar,
+ background,
+ color,
+ moderator,
+ name,
+}) => (
+
+
+ {name.slice(0, 2)}
+
+
+);
+
+User.propTypes = {
+ avatar: PropTypes.string.isRequired,
+ background: PropTypes.string.isRequired,
+ color: PropTypes.string.isRequired,
+ moderator: PropTypes.bool.isRequired,
+ name: PropTypes.string.isRequired,
+};
+
+export default User;
From 2db175ffa3a896b979f9f9a7f79d790f61a914a2 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 09:48:44 +0900
Subject: [PATCH 77/88] avatar
get whosText and captionText from {data}
---
.../imports/ui/components/captions/live/component.jsx | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
index 09944de82934..0dd482eb596e 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
@@ -80,18 +80,18 @@ class LiveCaptions extends PureComponent {
{clear ? null : (
)}
- {clear ? '' : data}
+ {clear ? '' : data.captionText}
- {clear ? '' : data}
+ {clear ? '' : data.captionText}
);
From aba10a743bd148a99765d07419b067ea287bd637 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 09:53:45 +0900
Subject: [PATCH 78/88] avatar
add requesterUserId as a variable to modifier/setTranscript. It will be used to set 'whosText" of Captions.
---
.../api/captions/server/methods/pushSpeechTranscript.js | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js b/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
index 17093b7dd576..401f4109a05f 100644
--- a/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
+++ b/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
@@ -18,8 +18,7 @@ function sendTranscript(meetingId, requesterUserId, type, dst, text) {
const textLf = `\n${text}`;
updatePad(meetingId, requesterUserId, dst, textLf); // Pad and recording
}
- //setTranscript(meetingId, dst, textWithName); // Live
- setTranscript(meetingId, dst, text); // Live
+ setTranscript(meetingId, dst, text, requesterUserId); // Live
}
function translateText(meetingId, requesterUserId, textOri, type, src, dst) {
From eb162d928dcf28b1b7993eb2ce08914af0cd1932 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 09:58:38 +0900
Subject: [PATCH 79/88] avatar
add whosText in Captions
---
.../imports/api/captions/server/modifiers/setTranscript.js | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/api/captions/server/modifiers/setTranscript.js b/bigbluebutton-html5/imports/api/captions/server/modifiers/setTranscript.js
index 2d7e1cc11c4e..a0d8335ab5ae 100644
--- a/bigbluebutton-html5/imports/api/captions/server/modifiers/setTranscript.js
+++ b/bigbluebutton-html5/imports/api/captions/server/modifiers/setTranscript.js
@@ -2,11 +2,12 @@ import { check } from 'meteor/check';
import Captions from '/imports/api/captions';
import Logger from '/imports/startup/server/logger';
-export default function setTranscript(meetingId, locale, transcript) {
+export default function setTranscript(meetingId, locale, transcript, whosText) {
try {
check(meetingId, String);
check(locale, String);
check(transcript, String);
+ check(whosText, String);
const selector = {
meetingId,
@@ -16,6 +17,7 @@ export default function setTranscript(meetingId, locale, transcript) {
const modifier = {
$set: {
transcript,
+ whosText,
},
};
From 3283c7014581832dd54b1c23fb27d06b5b814a03 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 10:04:44 +0900
Subject: [PATCH 80/88] avarat
Fix: type check
---
.../imports/ui/components/captions/live/component.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
index 0dd482eb596e..6a18f7466fe5 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
@@ -99,7 +99,7 @@ class LiveCaptions extends PureComponent {
}
LiveCaptions.propTypes = {
- data: PropTypes.string.isRequired,
+ data: PropTypes.object.isRequired,
};
export default LiveCaptions;
From 8fc33932c55cdc168a712d286ec3d0c71ede8cdc Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 10:10:28 +0900
Subject: [PATCH 81/88] avatar
pass object captionData: { captionText: formatCaptionsText(data), whosText: caption.whosText }, instead of the string formatCaptionsText(data).
---
.../imports/ui/components/captions/service.js | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/service.js b/bigbluebutton-html5/imports/ui/components/captions/service.js
index 42d83bda8177..406eb8e864ff 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/service.js
+++ b/bigbluebutton-html5/imports/ui/components/captions/service.js
@@ -198,7 +198,7 @@ const getCaptionsData = () => {
meetingId: Auth.meetingID,
locale,
},{
- fields: { dictating: 1, transcript: 1, translationDoner: 1 }
+ fields: { dictating: 1, transcript: 1, translationDoner: 1, whosText: 1 }
});
let data = '';
@@ -213,7 +213,8 @@ const getCaptionsData = () => {
data = caption.transcript;
}
}
- return formatCaptionsText(data);
+ const captionData = { captionText: formatCaptionsText(data), whosText: caption.whosText };
+ return captionData;
}
return '';
}
From 5243c6cce8f04e2c76ef0ed210e92ff3e2f6a04f Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Fri, 16 Jun 2023 17:58:41 +0900
Subject: [PATCH 82/88] avatar
caption bg translucent
---
bigbluebutton-html5/private/config/settings.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/private/config/settings.yml b/bigbluebutton-html5/private/config/settings.yml
index 460517747548..93f9247da065 100755
--- a/bigbluebutton-html5/private/config/settings.yml
+++ b/bigbluebutton-html5/private/config/settings.yml
@@ -453,7 +453,7 @@ public:
enableAutomaticTranslation: false
googleTranslateUrl: https://script.google.com/macros/s/YOUR_ID
deeplTranslateUrl: https://api-free.deepl.com/v2/translate?auth_key=YOUR_KEY
- background: '#000000'
+ background: '#000000a0'
font:
color: '#ffffff'
family: Calibri
From 180d8f7d95fddc7887a9623cb5834a2046cfde3b Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 18 Jun 2023 14:35:48 +0900
Subject: [PATCH 83/88] avatar
revert caption background alpha
---
bigbluebutton-html5/private/config/settings.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/private/config/settings.yml b/bigbluebutton-html5/private/config/settings.yml
index 93f9247da065..460517747548 100755
--- a/bigbluebutton-html5/private/config/settings.yml
+++ b/bigbluebutton-html5/private/config/settings.yml
@@ -453,7 +453,7 @@ public:
enableAutomaticTranslation: false
googleTranslateUrl: https://script.google.com/macros/s/YOUR_ID
deeplTranslateUrl: https://api-free.deepl.com/v2/translate?auth_key=YOUR_KEY
- background: '#000000a0'
+ background: '#000000'
font:
color: '#ffffff'
family: Calibri
From a947817bc935b3919ff82bdd6836ba9cc55a7388 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 18 Jun 2023 14:37:37 +0900
Subject: [PATCH 84/88] avatar
add alpha transparency to all background colors
---
.../imports/ui/components/captions/live/component.jsx | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
index 6a18f7466fe5..9c01db4ecf43 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
@@ -55,12 +55,13 @@ class LiveCaptions extends PureComponent {
display: 'flex',
};
+ const backgroundColorAlpha = backgroundColor.match(/^#[0-9a-fA-F]{6}$/) ? backgroundColor + 'a0' : backgroundColor;
const captionStyles = {
whiteSpace: 'pre-wrap',
wordWrap: 'break-word',
fontFamily,
fontSize,
- background: backgroundColor,
+ background: backgroundColorAlpha,
color: fontColor,
};
From c8e9134a56fdaf3ea24e5f5fe6fb1fc027014d9f Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 18 Jun 2023 20:18:23 +0900
Subject: [PATCH 85/88] avatar
remove minHeight for correct 2-line limitation in #212
---
.../imports/ui/components/captions/live/user/component.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
index 1fb3d2beee6a..91f891976964 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/user/component.jsx
@@ -12,7 +12,7 @@ const User = ({
Date: Sun, 18 Jun 2023 20:39:50 +0900
Subject: [PATCH 86/88] avatar
add align-items: 'flex-end'
remove background="#000000a0", which does not do the job anyway after removing the size definition of avatar
---
.../imports/ui/components/captions/live/component.jsx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
index 9c01db4ecf43..4da642dd3871 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
@@ -53,6 +53,7 @@ class LiveCaptions extends PureComponent {
const wrapperStyles = {
display: 'flex',
+ alignItems: 'flex-end',
};
const backgroundColorAlpha = backgroundColor.match(/^#[0-9a-fA-F]{6}$/) ? backgroundColor + 'a0' : backgroundColor;
@@ -80,7 +81,6 @@ class LiveCaptions extends PureComponent {
{clear ? null : (
)}
From 798e382a7fb58b148de654e348d5662c9d6e1e93 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Sun, 18 Jun 2023 21:01:29 +0900
Subject: [PATCH 87/88] avatar
set gap between avatar and caption
---
.../imports/ui/components/captions/live/component.jsx | 1 +
1 file changed, 1 insertion(+)
diff --git a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
index 4da642dd3871..e6e9b7cf561d 100644
--- a/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
+++ b/bigbluebutton-html5/imports/ui/components/captions/live/component.jsx
@@ -54,6 +54,7 @@ class LiveCaptions extends PureComponent {
const wrapperStyles = {
display: 'flex',
alignItems: 'flex-end',
+ gap: '0em 0.5em',
};
const backgroundColorAlpha = backgroundColor.match(/^#[0-9a-fA-F]{6}$/) ? backgroundColor + 'a0' : backgroundColor;
From 875f2ef21ecb996b72c7963cf91085df8e863fe5 Mon Sep 17 00:00:00 2001
From: hiroshisuga <45039819+hiroshisuga@users.noreply.github.com>
Date: Thu, 29 Jun 2023 12:19:46 +0900
Subject: [PATCH 88/88] Google Translation locale without -XX
---
.../imports/api/captions/server/methods/pushSpeechTranscript.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js b/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
index 401f4109a05f..34baa389a98f 100644
--- a/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
+++ b/bigbluebutton-html5/imports/api/captions/server/methods/pushSpeechTranscript.js
@@ -28,7 +28,7 @@ function translateText(meetingId, requesterUserId, textOri, type, src, dst) {
let url = '';
if (CAPTIONS_CONFIG.googleTranslateUrl) {
url = CAPTIONS_CONFIG.googleTranslateUrl + '/exec?' +
- 'text=' + encodeURIComponent(textOri) + '&source=' + src + '&target=' + dst;
+ 'text=' + encodeURIComponent(textOri) + '&source=' + src + '&target=' + dst.replace(/-..$/,'');
} else if (CAPTIONS_CONFIG.deeplTranslateUrl) {
url = CAPTIONS_CONFIG.deeplTranslateUrl +
'&text=' + encodeURIComponent(textOri) + '&source_lang=' + src.replace(/-..$/,'').toUpperCase() +