emial link, breakout, end call

This commit is contained in:
2026-05-17 22:52:13 +05:30
parent e4837b8cb1
commit fe54d1c9e6
3 changed files with 298 additions and 22 deletions

View File

@@ -766,6 +766,7 @@ var config = {
// Disables profile and the edit of all fields from the profile settings (display name and email) // Disables profile and the edit of all fields from the profile settings (display name and email)
// disableProfile: false, // disableProfile: false,
disableProfile: true,
// Hides the email section under profile settings. // Hides the email section under profile settings.
// hideEmailInSettings: false, // hideEmailInSettings: false,
@@ -802,6 +803,7 @@ var config = {
// When 'true', the user cannot edit the display name. // When 'true', the user cannot edit the display name.
// (Mainly useful when used in conjunction with the JWT so the JWT name becomes read only.) // (Mainly useful when used in conjunction with the JWT so the JWT name becomes read only.)
// readOnlyName: false, // readOnlyName: false,
readOnlyName: true,
// If etherpad integration is enabled, setting this to true will // If etherpad integration is enabled, setting this to true will
// automatically open the etherpad when a participant joins. This // automatically open the etherpad when a participant joins. This
@@ -1498,14 +1500,12 @@ var config = {
}, },
// Options related to the breakout rooms feature. // Options related to the breakout rooms feature.
// breakoutRooms: { breakoutRooms: {
// // Hides the add breakout room button. This replaces `hideAddRoomButton`. // PoliticTalk uses one moderated room only.
// hideAddRoomButton: false, hideAddRoomButton: true,
// // Hides the auto assign participants button. hideAutoAssignButton: true,
// hideAutoAssignButton: false, hideJoinRoomButton: true
// // Hides the join breakout room button. },
// hideJoinRoomButton: false,
// },
// When true, virtual background feature will be disabled. // When true, virtual background feature will be disabled.
// disableVirtualBackground: false, // disableVirtualBackground: false,

View File

@@ -17,6 +17,8 @@ config.startWithVideoMuted = true;
config.disableSelfView = true; config.disableSelfView = true;
config.disableSelfViewSettings = true; config.disableSelfViewSettings = true;
config.disableLocalVideoFlip = true; config.disableLocalVideoFlip = true;
config.disableProfile = true;
config.readOnlyName = true;
config.disableChat = false; config.disableChat = false;
config.disablePolls = false; config.disablePolls = false;
@@ -67,6 +69,12 @@ config.participantsPane = {
hideMuteAllButton: false hideMuteAllButton: false
}; };
config.breakoutRooms = {
hideAddRoomButton: true,
hideAutoAssignButton: true,
hideJoinRoomButton: true
};
config.e2ee = { config.e2ee = {
externallyManagedKey: false, externallyManagedKey: false,
disabled: false, disabled: false,

View File

@@ -19,6 +19,85 @@
width: 100%; width: 100%;
} }
html.politictalk-direct-access-blocked,
html.politictalk-direct-access-blocked body {
background: #202424 !important;
min-height: 100%;
}
html.politictalk-direct-access-blocked #react {
display: none !important;
}
.politictalk-direct-access {
align-items: center;
background: rgba(13, 15, 16, 0.48);
box-sizing: border-box;
display: flex;
inset: 0;
justify-content: center;
padding: 24px;
position: fixed;
z-index: 2147482999;
}
.politictalk-direct-access__dialog {
background: #111111;
border: 1px solid rgba(255, 255, 255, 0.16);
border-radius: 8px;
box-shadow: 0 22px 64px rgba(0, 0, 0, 0.32);
box-sizing: border-box;
color: #f5f5f5;
max-width: 520px;
padding: 32px;
width: min(100%, 520px);
}
.politictalk-direct-access__title {
font-family: inherit;
font-size: 26px;
font-weight: 700;
line-height: 1.2;
margin: 0 0 16px;
}
.politictalk-direct-access__message {
color: rgba(255, 255, 255, 0.78);
font-size: 17px;
line-height: 1.5;
margin: 0;
}
.politictalk-direct-access__actions {
display: flex;
justify-content: flex-end;
margin-top: 28px;
}
.politictalk-direct-access__button {
background: #ffffff;
border: 0;
border-radius: 6px;
color: #151515;
cursor: pointer;
font-size: 16px;
font-weight: 700;
min-width: 96px;
padding: 13px 22px;
}
.politictalk-direct-access__button:focus {
outline: 3px solid rgba(255, 255, 255, 0.42);
outline-offset: 3px;
}
html.politictalk-host-user button[aria-label*="Leave meeting" i],
html.politictalk-host-user button[aria-label*="Leave conference" i],
html.politictalk-host-user [role="button"][aria-label*="Leave meeting" i],
html.politictalk-host-user [role="button"][aria-label*="Leave conference" i] {
display: none !important;
}
@media (max-width: 640px) { @media (max-width: 640px) {
.politictalk-room-logo { .politictalk-room-logo {
height: 52px; height: 52px;
@@ -26,11 +105,52 @@
top: max(12px, env(safe-area-inset-top)); top: max(12px, env(safe-area-inset-top));
width: 52px; width: 52px;
} }
.politictalk-direct-access {
align-items: flex-start;
padding: 132px 18px 18px;
}
.politictalk-direct-access__dialog {
padding: 24px;
}
.politictalk-direct-access__title {
font-size: 24px;
}
} }
</style> </style>
<script> <script>
(function() { (function() {
var PARALLEL_GLOBE_URL = 'https://parallelglobe.io';
var directAccessBlocked = isDirectRoomAccess();
if (directAccessBlocked) {
document.documentElement.classList.add('politictalk-direct-access-blocked');
document.title = 'Access required - PoliticTalk';
}
function hasMeetingToken() {
var params = new URLSearchParams(window.location.search);
return Boolean(params.get('jwt') || params.get('token'));
}
function isDirectRoomAccess() {
var path = window.location.pathname.replace(/\/+$/, '');
if (!path || path === '/') {
return false;
}
if (/^\/(?:static|images|libs|css|sounds|fonts|transcripts)\//.test(path)) {
return false;
}
return !hasMeetingToken();
}
function decodeBase64Url(value) { function decodeBase64Url(value) {
var base64 = value.replace(/-/g, '+').replace(/_/g, '/'); var base64 = value.replace(/-/g, '+').replace(/_/g, '/');
@@ -48,27 +168,47 @@
return new TextDecoder().decode(bytes); return new TextDecoder().decode(bytes);
} }
function getPoliticTalkMeetingTitle() { function getMeetingToken() {
return new URLSearchParams(window.location.search).get('jwt') || '';
}
function getPoliticTalkJwtPayload() {
try { try {
var token = new URLSearchParams(window.location.search).get('jwt'); var token = getMeetingToken();
if (!token) { if (!token) {
return ''; return null;
} }
var payload = JSON.parse(decodeBase64Url(token.split('.')[1] || '')); return JSON.parse(decodeBase64Url(token.split('.')[1] || ''));
var context = payload.context || {};
var room = context.room || {};
var title = (context.politictalk && context.politictalk.title)
|| room.subject
|| room.name
|| '';
title = String(title);
return title.trim() ? title : '';
} catch (error) { } catch (error) {
return null;
}
}
function getPoliticTalkMeetingTitle() {
var payload = getPoliticTalkJwtPayload();
if (!payload) {
return ''; return '';
} }
var context = payload.context || {};
var room = context.room || {};
var title = (context.politictalk && context.politictalk.title)
|| room.subject
|| room.name
|| '';
title = String(title);
return title.trim() ? title : '';
}
function isPoliticTalkHost() {
var payload = getPoliticTalkJwtPayload();
var user = payload && payload.context && payload.context.user;
return Boolean(user && user.moderator);
} }
function applyPoliticTalkMeetingTitle() { function applyPoliticTalkMeetingTitle() {
@@ -83,6 +223,83 @@
window.config.localSubject = meetingTitle; window.config.localSubject = meetingTitle;
} }
function preventHostLeaveButtonExecution() {
if (!isPoliticTalkHost()) {
return;
}
var buttons = window.config && window.config.buttonsWithNotifyClick;
if (!Array.isArray(buttons)) {
buttons = [];
}
buttons = buttons.filter(function(button) {
var key = typeof button === 'string' ? button : button && button.key;
return key !== 'hangup';
});
buttons.push('hangup');
window.config = window.config || {};
window.config.buttonsWithNotifyClick = buttons;
}
function isLeaveMeetingControl(element) {
var label = [
element.getAttribute('aria-label'),
element.getAttribute('title'),
element.textContent
].join(' ').replace(/\s+/g, ' ').trim().toLowerCase();
return label.indexOf('leave meeting') !== -1
|| label.indexOf('leave conference') !== -1;
}
function hideHostLeaveMeetingControls() {
if (!isPoliticTalkHost() || !document.body) {
return;
}
var controls = document.querySelectorAll('button, [role="button"]');
controls.forEach(function(control) {
if (!isLeaveMeetingControl(control)) {
return;
}
control.classList.add('politictalk-host-hidden-leave');
control.setAttribute('aria-hidden', 'true');
control.setAttribute('tabindex', '-1');
control.style.display = 'none';
});
}
function mountHostHangupPolicy() {
if (!isPoliticTalkHost() || !document.body) {
return;
}
document.documentElement.classList.add('politictalk-host-user');
preventHostLeaveButtonExecution();
hideHostLeaveMeetingControls();
if (window.politicTalkHostHangupObserver) {
return;
}
window.politicTalkHostHangupObserver = new MutationObserver(function() {
window.requestAnimationFrame(hideHostLeaveMeetingControls);
});
window.politicTalkHostHangupObserver.observe(document.body, {
attributes: true,
attributeFilter: [ 'aria-label', 'title', 'class' ],
childList: true,
characterData: true,
subtree: true
});
}
function mountPoliticTalkLogo() { function mountPoliticTalkLogo() {
if (!document.body || document.getElementById('politictalk-room-logo')) { if (!document.body || document.getElementById('politictalk-room-logo')) {
return; return;
@@ -103,12 +320,63 @@
document.body.appendChild(link); document.body.appendChild(link);
} }
function mountDirectAccessMessage() {
if (!directAccessBlocked || !document.body || document.getElementById('politictalk-direct-access')) {
return;
}
var wrapper = document.createElement('div');
wrapper.className = 'politictalk-direct-access';
wrapper.id = 'politictalk-direct-access';
var dialog = document.createElement('div');
dialog.className = 'politictalk-direct-access__dialog';
dialog.setAttribute('aria-labelledby', 'politictalk-direct-access-title');
dialog.setAttribute('aria-modal', 'true');
dialog.setAttribute('role', 'dialog');
var title = document.createElement('h1');
title.className = 'politictalk-direct-access__title';
title.id = 'politictalk-direct-access-title';
title.textContent = 'Parallel Globe account required';
var message = document.createElement('p');
message.className = 'politictalk-direct-access__message';
message.textContent = 'This PoliticTalk room cannot be opened directly. Please create an account or sign in at Parallel Globe to join PoliticTalk sessions.';
var actions = document.createElement('div');
actions.className = 'politictalk-direct-access__actions';
var button = document.createElement('button');
button.className = 'politictalk-direct-access__button';
button.textContent = 'OK';
button.type = 'button';
button.addEventListener('click', function() {
window.location.href = PARALLEL_GLOBE_URL;
});
actions.appendChild(button);
dialog.appendChild(title);
dialog.appendChild(message);
dialog.appendChild(actions);
wrapper.appendChild(dialog);
document.body.appendChild(wrapper);
button.focus();
}
applyPoliticTalkMeetingTitle(); applyPoliticTalkMeetingTitle();
preventHostLeaveButtonExecution();
if (document.readyState === 'loading') { if (document.readyState === 'loading') {
document.addEventListener('DOMContentLoaded', mountPoliticTalkLogo); document.addEventListener('DOMContentLoaded', function() {
mountPoliticTalkLogo();
mountDirectAccessMessage();
mountHostHangupPolicy();
});
} else { } else {
mountPoliticTalkLogo(); mountPoliticTalkLogo();
mountDirectAccessMessage();
mountHostHangupPolicy();
} }
}()); }());
</script> </script>