Compare commits
No commits in common. "d3a109a0cc283eb6eecd529ac76997081370a981" and "a5af009ba84fb690cc167abd45fa31c9192b14c0" have entirely different histories.
d3a109a0cc
...
a5af009ba8
6 changed files with 15 additions and 166 deletions
|
|
@ -702,19 +702,6 @@ function renderVideo(peerId, displayName, stream, source) {
|
||||||
<video id="${videoId}" autoplay playsinline ${peerId === state.me.id ? "muted" : ""}></video>
|
<video id="${videoId}" autoplay playsinline ${peerId === state.me.id ? "muted" : ""}></video>
|
||||||
<div class="video-label">${label}</div>
|
<div class="video-label">${label}</div>
|
||||||
`;
|
`;
|
||||||
container.onclick = () => {
|
|
||||||
const isFullscreen = container.classList.contains('fullscreen');
|
|
||||||
// Reset all
|
|
||||||
document.querySelectorAll('.video-item').forEach(el => el.classList.remove('fullscreen'));
|
|
||||||
|
|
||||||
if (isFullscreen) {
|
|
||||||
el.videoGrid.classList.remove('has-fullscreen');
|
|
||||||
} else {
|
|
||||||
container.classList.add('fullscreen');
|
|
||||||
el.videoGrid.classList.add('has-fullscreen');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
el.videoGrid.appendChild(container);
|
el.videoGrid.appendChild(container);
|
||||||
videoEl = container.querySelector("video");
|
videoEl = container.querySelector("video");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -638,14 +638,7 @@ select {
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: all var(--transition);
|
transition: box-shadow var(--transition);
|
||||||
cursor: pointer;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item:hover {
|
|
||||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-item video {
|
.video-item video {
|
||||||
|
|
@ -653,37 +646,6 @@ select {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
background: #000;
|
background: #000;
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fullscreen Feed Support */
|
|
||||||
.video-grid.has-fullscreen {
|
|
||||||
display: flex;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
position: absolute;
|
|
||||||
top: 48px;
|
|
||||||
/* Below chat-header */
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 100;
|
|
||||||
background: var(--bg-main);
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-grid.has-fullscreen .video-item {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-grid.has-fullscreen .video-item.fullscreen {
|
|
||||||
display: block;
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
cursor: zoom-out;
|
|
||||||
z-index: 10;
|
|
||||||
aspect-ratio: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-item .video-label {
|
.video-item .video-label {
|
||||||
|
|
@ -697,8 +659,6 @@ select {
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
pointer-events: none;
|
|
||||||
z-index: 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Voice Activity */
|
/* Voice Activity */
|
||||||
|
|
@ -826,7 +786,6 @@ select {
|
||||||
/* Chat Pane */
|
/* Chat Pane */
|
||||||
/* ═══════════════════════════════════════════════════════════ */
|
/* ═══════════════════════════════════════════════════════════ */
|
||||||
.chat-pane {
|
.chat-pane {
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: var(--bg-main);
|
background: var(--bg-main);
|
||||||
|
|
|
||||||
30
main.js
30
main.js
|
|
@ -64,36 +64,29 @@ function createWindow() {
|
||||||
|
|
||||||
console.log(`Loading desktop app from: ${localUrl}`);
|
console.log(`Loading desktop app from: ${localUrl}`);
|
||||||
|
|
||||||
const loadDesktopApp = (queryParams = '') => {
|
const loadDesktopApp = () => {
|
||||||
const fullUrl = queryParams ? `${localUrl}&${queryParams}` : localUrl;
|
win.loadURL(localUrl).catch((err) => {
|
||||||
win.loadURL(fullUrl).catch((err) => {
|
|
||||||
console.error(`Failed to load desktop file: ${err}`);
|
console.error(`Failed to load desktop file: ${err}`);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
// Use a navigation listener to detect when the remote login is complete
|
// Use a navigation listener to detect when the remote login is complete
|
||||||
win.webContents.on('will-navigate', (event, navigatedUrl) => {
|
win.webContents.on('will-navigate', (event, navigatedUrl) => {
|
||||||
try {
|
const normalizedNav = navigatedUrl.replace(/\/$/, '');
|
||||||
const urlObj = new URL(navigatedUrl);
|
// If the user lands back on the remote root, they are logged in.
|
||||||
const backendObj = new URL(backendUrl);
|
// Redirect them back to our local bugfixed desktop UI.
|
||||||
if (urlObj.origin === backendObj.origin && urlObj.pathname === '/') {
|
if (normalizedNav === backendUrl) {
|
||||||
console.log("Detected remote landing (login success), returning to desktop UI...");
|
console.log("Detected remote landing (login success), returning to desktop UI...");
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
loadDesktopApp(urlObj.search.slice(1));
|
loadDesktopApp();
|
||||||
}
|
|
||||||
} catch (e) {
|
|
||||||
console.error(e);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
win.webContents.on('did-navigate', (event, navigatedUrl) => {
|
win.webContents.on('did-navigate', (event, navigatedUrl) => {
|
||||||
try {
|
const normalizedNav = navigatedUrl.replace(/\/$/, '');
|
||||||
const urlObj = new URL(navigatedUrl);
|
if (normalizedNav === backendUrl) {
|
||||||
const backendObj = new URL(backendUrl);
|
loadDesktopApp();
|
||||||
if (urlObj.origin === backendObj.origin && urlObj.pathname === '/') {
|
|
||||||
loadDesktopApp(urlObj.search.slice(1));
|
|
||||||
}
|
}
|
||||||
} catch (e) { }
|
|
||||||
});
|
});
|
||||||
|
|
||||||
loadDesktopApp();
|
loadDesktopApp();
|
||||||
|
|
@ -102,9 +95,6 @@ function createWindow() {
|
||||||
// win.webContents.openDevTools();
|
// win.webContents.openDevTools();
|
||||||
}
|
}
|
||||||
|
|
||||||
app.commandLine.appendSwitch('disable-webrtc-hw-encoding'); // Sometime helps resolve codec mismatch behavior
|
|
||||||
app.commandLine.appendSwitch('log-level', '3'); // Silences standard Chromium warning logs (like SRTP transport unprotect logs which are benign timing issues)
|
|
||||||
|
|
||||||
app.whenReady().then(() => {
|
app.whenReady().then(() => {
|
||||||
createWindow();
|
createWindow();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -684,19 +684,6 @@ function renderVideo(peerId, displayName, stream, source) {
|
||||||
<video id="${videoId}" autoplay playsinline ${peerId === state.me.id ? "muted" : ""}></video>
|
<video id="${videoId}" autoplay playsinline ${peerId === state.me.id ? "muted" : ""}></video>
|
||||||
<div class="video-label">${label}</div>
|
<div class="video-label">${label}</div>
|
||||||
`;
|
`;
|
||||||
container.onclick = () => {
|
|
||||||
const isFullscreen = container.classList.contains('fullscreen');
|
|
||||||
// Reset all
|
|
||||||
document.querySelectorAll('.video-item').forEach(el => el.classList.remove('fullscreen'));
|
|
||||||
|
|
||||||
if (isFullscreen) {
|
|
||||||
el.videoGrid.classList.remove('has-fullscreen');
|
|
||||||
} else {
|
|
||||||
container.classList.add('fullscreen');
|
|
||||||
el.videoGrid.classList.add('has-fullscreen');
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
el.videoGrid.appendChild(container);
|
el.videoGrid.appendChild(container);
|
||||||
videoEl = container.querySelector("video");
|
videoEl = container.querySelector("video");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -638,14 +638,7 @@ select {
|
||||||
background: #000;
|
background: #000;
|
||||||
border-radius: var(--radius-lg);
|
border-radius: var(--radius-lg);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
transition: all var(--transition);
|
transition: box-shadow var(--transition);
|
||||||
cursor: pointer;
|
|
||||||
z-index: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-item:hover {
|
|
||||||
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2);
|
|
||||||
z-index: 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-item video {
|
.video-item video {
|
||||||
|
|
@ -653,37 +646,6 @@ select {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
background: #000;
|
background: #000;
|
||||||
pointer-events: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Fullscreen Feed Support */
|
|
||||||
.video-grid.has-fullscreen {
|
|
||||||
display: flex;
|
|
||||||
padding: 0;
|
|
||||||
overflow: hidden;
|
|
||||||
position: absolute;
|
|
||||||
top: 48px;
|
|
||||||
/* Below chat-header */
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
bottom: 0;
|
|
||||||
z-index: 100;
|
|
||||||
background: var(--bg-main);
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-grid.has-fullscreen .video-item {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.video-grid.has-fullscreen .video-item.fullscreen {
|
|
||||||
display: block;
|
|
||||||
flex: 1;
|
|
||||||
width: 100%;
|
|
||||||
height: 100%;
|
|
||||||
border-radius: 0;
|
|
||||||
cursor: zoom-out;
|
|
||||||
z-index: 10;
|
|
||||||
aspect-ratio: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-item .video-label {
|
.video-item .video-label {
|
||||||
|
|
@ -697,8 +659,6 @@ select {
|
||||||
border-radius: 100px;
|
border-radius: 100px;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
font-weight: 500;
|
font-weight: 500;
|
||||||
pointer-events: none;
|
|
||||||
z-index: 5;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Voice Activity */
|
/* Voice Activity */
|
||||||
|
|
@ -826,7 +786,6 @@ select {
|
||||||
/* Chat Pane */
|
/* Chat Pane */
|
||||||
/* ═══════════════════════════════════════════════════════════ */
|
/* ═══════════════════════════════════════════════════════════ */
|
||||||
.chat-pane {
|
.chat-pane {
|
||||||
position: relative;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
background: var(--bg-main);
|
background: var(--bg-main);
|
||||||
|
|
|
||||||
33
test.html
33
test.html
|
|
@ -1,33 +0,0 @@
|
||||||
<!DOCTYPE html>
|
|
||||||
<html>
|
|
||||||
<head>
|
|
||||||
<link rel="stylesheet" href="static/styles.css" />
|
|
||||||
<style>
|
|
||||||
body { margin: 0; height: 100vh; display: flex; }
|
|
||||||
.chat-pane { flex: 1; position: relative; background: #333; }
|
|
||||||
.chat-header { height: 48px; background: #222; }
|
|
||||||
</style>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div class="chat-pane">
|
|
||||||
<div class="chat-header">Header</div>
|
|
||||||
<div id="video-grid" class="video-grid">
|
|
||||||
<div class="video-item" onclick="toggle(this)" style="display:flex; justify-content:center; align-items:center; color:white;">Click me</div>
|
|
||||||
<div class="video-item" style="color:white;">Another</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
function toggle(el) {
|
|
||||||
const grid = document.getElementById('video-grid');
|
|
||||||
const isFullscreen = el.classList.contains('fullscreen');
|
|
||||||
document.querySelectorAll('.video-item').forEach(e => e.classList.remove('fullscreen'));
|
|
||||||
if (isFullscreen) {
|
|
||||||
grid.classList.remove('has-fullscreen');
|
|
||||||
} else {
|
|
||||||
el.classList.add('fullscreen');
|
|
||||||
grid.classList.add('has-fullscreen');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue