mirror of
https://github.com/EchoSixHIYA/WebSpeak-client-for-TeamSpeak.git
synced 2026-12-03 12:02:50 +08:00
Fix screen-share letterboxing across skins
This commit is contained in:
1 parent
acdc7a2330
commit
833357e278
22 files changed
+67
-65
No files matched your search
@@ -574,3 +574,9 @@
|
||||
- 根因:观看状态分别由 `screenShareViewing` 和 `screenShareViewingStreamId` 保存,UI 卡片用后者、播放器用前者,二者可能失步;同时播放器通过函数 ref 更新响应式尺寸对象,重渲染时会反复触发 ref,形成布局渲染反馈。播放器自身也没有压过语音活动装饰层。
|
||||
- 修复:以当前观看流 ID 作为唯一观看状态;尺寸改为对 DOM 样式做幂等更新,并在 ref 节点未变化时跳过;移除父级 `ResizeObserver`;播放器提升到装饰层之上。共享流及窗口尺寸仍按视频元数据、视口变化和全屏状态更新。
|
||||
- 验证:屏幕共享定向测试 16/16 通过;`npm run verify` 全部通过(690/690 测试、服务端 TypeScript 编译、前端类型检查与 Vite 生产构建);`git diff --check` 通过。3040 返回当前构建入口 200,新版 WebClient JS(438,183 字节)和 CSS(160,719 字节)均返回 200。
|
||||
|
||||
## 本轮播放器精修(2026-10-12,固定画布并以黑边适配视频)
|
||||
|
||||
- 用户补充目标:播放器保持固定的宽屏画布;共享画面比例与画布不同时完整显示,并在空余区域留黑边。
|
||||
- 修改范围:WebSpeak 通用播放器在内容区内最多 1100px 宽、固定 16:9 比例;移除按视频元数据改写舞台宽高的逻辑,视频使用 `object-fit: contain`,舞台和视频底色为黑色。浅色、深色、ILLUSIA 和 KAAK 都明确保留黑色留边;三款内置皮肤版本分别升至 1.0.2、1.0.2、2.0.2,KAAK 升至 3.1.74,并重建 ILLUSIA 与 KAAK 示例及内置 `.wskin` 包。全屏仍铺满视口;不裁切、不拉伸视频。
|
||||
- 回归验证:断言验证固定画布、完整显示、四款皮肤黑边规则和皮肤包版本同步;`npm run verify` 通过(690/690 测试、服务端构建、前端类型检查与 Vite 生产构建);两款可分发皮肤包均可导入且示例包与内置包字节一致;`git diff --check` 通过。3040 提供的 WebClient JS(437,529 字节)和 CSS(160,602 字节)均返回 HTTP 200;CSS 包含播放器舞台、`object-fit: contain` 和黑底规则。
|
||||
@@ -1,6 +1,6 @@
|
||||
# ILLUSIA风
|
||||
|
||||
ILLUSIA 风格 is a schema v3 open-skin example built from the local artwork in [illusia-voice/assets](./illusia-voice/assets/). Version 2.0.1 keeps its existing light-glass CSS and current-channel card, and adds matching visual treatment for the host member-card screen-share status and watch action. The package still uses WebSpeak's base translations and contains no executable skin code.
|
||||
ILLUSIA 风格 is a schema v3 open-skin example built from the local artwork in [illusia-voice/assets](./illusia-voice/assets/). Version 2.0.2 keeps its existing light-glass CSS and current-channel card, adds matching visual treatment for the host member-card screen-share status and watch action, and uses a black letterbox background for the fixed WebSpeak screen-share player. The package still uses WebSpeak's base translations and contains no executable skin code.
|
||||
|
||||
The new voice-page component is defined in [components.json](./illusia-voice/components.json). It reads only the current public channel name through session.status.read and uses a local mascot image for a compact, non-interactive glass badge. The component needs the user's local approval before it renders; that approval is scoped to this skin version and can be revoked from the host access control. It cannot switch channels, read favorites, access a server address, or control audio.
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ The owner authorized inspection of the first two voice rooms in the KOOK server.
|
||||
|
||||
## Components and permissions
|
||||
|
||||
The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen-share status/read/control. Its member-card widget explicitly enables share status and watch actions; the KAAK dock uses the host's screen-share control. The performance panel hides only share transport metrics. The host renders trusted connection, language, skin, and audio controls. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control.
|
||||
The connection page and voice workspace are full-page declarative surfaces in [components.json](./kaak-voice/components.json). The voice surface requests only the capabilities it uses: visible server shortcuts, channel and member data, cached profile-avatar display inside the trusted member-card widget, channel joining, channel chat, voice status, microphone/output controls, whisper controls, disconnect, and screen-share status/read/control. Its member-card widget explicitly enables share status and watch actions; the KAAK dock uses the host's screen-share control. The performance panel hides only share transport metrics. The host renders trusted connection, language, skin, and audio controls. KAAK 3.1.74 keeps the shared-screen player on WebSpeak's fixed 16:9 canvas and shows the full source image with black letterboxing. It rechecks permissions and connection state when each action runs; approval is local to this skin version and can be revoked from the host access control.
|
||||
|
||||
The server header uses the live, privacy-filtered TeamSpeak server label and a trusted `voice.server-switcher` menu backed by favorites and recent connections. Its click handler reuses WebSpeak's existing connection flow with an opaque local ID; addresses and credentials never enter skin data. The left panel uses the trusted `voice.channel-tree` widget to retain TeamSpeak channel nesting, member counts and capacity, available avatars, and mute/speaking/away states. Expanding a branch is local UI state, a single click selects a channel, and double-click joins it. With `memberActions` enabled, right-clicking another member row opens WebSpeak's existing host-owned action menu. With `memberDragDrop` enabled, another member can be dragged onto a different channel row; the member row and target channel receive visual feedback, and the host reuses its existing move-client operation. Both options default off for other skins. The skin does not add KOOK's separate text-channel list.
|
||||
|
||||
|
||||
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.illusia-voice",
|
||||
"name": "ILLUSIA风",
|
||||
"version": "2.0.1",
|
||||
"version": "2.0.2",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "All rights reserved",
|
||||
"description": "A bright original-character art skin with a safe declarative live-channel badge.",
|
||||
|
||||
@@ -891,11 +891,12 @@
|
||||
|
||||
[data-ws-part="voice.screen-player.stage"] {
|
||||
border-radius: 22px;
|
||||
background: radial-gradient(ellipse at 50% 38%, rgba(248, 255, 255, .98), rgba(220, 246, 250, .92) 58%, rgba(202, 237, 244, .9));
|
||||
background: #000;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.video"] {
|
||||
background: #e5f4f8;
|
||||
object-fit: contain;
|
||||
background: #000;
|
||||
}
|
||||
|
||||
[data-ws-part="voice.screen-player.placeholder"] {
|
||||
|
||||
Binary file not shown.
@@ -3,7 +3,7 @@
|
||||
"packageType": "open-skin",
|
||||
"id": "community.kaak-voice",
|
||||
"name": "KAAK",
|
||||
"version": "3.1.73",
|
||||
"version": "3.1.74",
|
||||
"author": "WebSpeak Project",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "A KOOK-inspired voice workspace with a searchable server header, TeamSpeak banner and welcome message, nested channel members, attached channel chat, and a compact WebSpeak audio dock.",
|
||||
|
||||
@@ -1682,6 +1682,8 @@
|
||||
background: #20251e;
|
||||
box-shadow: 0 5px 16px rgba(0, 0, 0, .42), inset 0 0 0 1px rgba(108, 191, 0, .08);
|
||||
}
|
||||
[data-ws-plugin-part="kaak-workspace"] [data-ws-part="voice.screen-player.stage"] { background: #000; }
|
||||
[data-ws-plugin-part="kaak-workspace"] [data-ws-part="voice.screen-player.video"] { object-fit: contain; background: #000; }
|
||||
[data-ws-plugin-part="kaak-workspace.member-cards"] .screen-share-live-indicator::before {
|
||||
background: #7bd80a;
|
||||
box-shadow: 0 0 0 3px rgba(123, 216, 10, .18);
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -117,7 +117,6 @@
|
||||
import Icon from "../Icon.vue";
|
||||
import { onBeforeUnmount, onMounted, ref, watch } from "vue";
|
||||
import type { useWebClientScreenShare } from "../../composables/useWebClientScreenShare.js";
|
||||
import { calculateScreenSharePlayerSize } from "../../composables/useWebClientScreenShare.js";
|
||||
const props = defineProps<{
|
||||
model: Pick<ReturnType<typeof useWebClientScreenShare>, "fullscreen" | "viewers" | "viewerCount" | "ownerName" | "errorText" | "setPlayerElement" | "setVideoElement" | "viewerStyle" | "setVolume" | "toggleFullscreen">;
|
||||
screenShareRemoteStream: MediaStream | null; screenShareRemoteVolume: number; screenShareError: string;
|
||||
@@ -138,7 +137,6 @@ function setInlineStyle(element: HTMLElement, property: string, value: string |
|
||||
function updateStageSize(): void {
|
||||
const stage = stageElement.value;
|
||||
const player = playerElement.value ?? stage?.parentElement ?? null;
|
||||
const video = stage?.querySelector("video");
|
||||
if (!stage || !player) return;
|
||||
if (screenShareFullscreen.value) {
|
||||
setInlineStyle(player, "width", "100vw");
|
||||
@@ -150,24 +148,9 @@ function updateStageSize(): void {
|
||||
}
|
||||
setInlineStyle(player, "width", null);
|
||||
setInlineStyle(player, "height", null);
|
||||
if (!video?.videoWidth || !video.videoHeight) {
|
||||
setInlineStyle(stage, "width", null);
|
||||
setInlineStyle(stage, "height", null);
|
||||
setInlineStyle(stage, "aspect-ratio", "16 / 9");
|
||||
return;
|
||||
}
|
||||
const parentWidth = stage.parentElement?.parentElement?.clientWidth || window.innerWidth;
|
||||
const size = calculateScreenSharePlayerSize(
|
||||
video.videoWidth,
|
||||
video.videoHeight,
|
||||
Math.min(parentWidth, 1100),
|
||||
Math.max(220, Math.min(window.innerHeight - 220, 720)),
|
||||
);
|
||||
if (!size) return;
|
||||
setInlineStyle(player, "width", `${size.width + 2}px`);
|
||||
setInlineStyle(stage, "width", `${size.width}px`);
|
||||
setInlineStyle(stage, "height", `${size.height}px`);
|
||||
setInlineStyle(stage, "aspect-ratio", `${video.videoWidth} / ${video.videoHeight}`);
|
||||
setInlineStyle(stage, "width", null);
|
||||
setInlineStyle(stage, "height", null);
|
||||
setInlineStyle(stage, "aspect-ratio", "16 / 9");
|
||||
}
|
||||
|
||||
function setPlayerElementNode(element: unknown): void {
|
||||
|
||||
@@ -10,20 +10,6 @@ interface ScreenShareResolutionOption {
|
||||
label: string;
|
||||
}
|
||||
|
||||
export function calculateScreenSharePlayerSize(
|
||||
sourceWidth: number,
|
||||
sourceHeight: number,
|
||||
maxWidth: number,
|
||||
maxHeight: number,
|
||||
): { width: number; height: number } | null {
|
||||
if (![sourceWidth, sourceHeight, maxWidth, maxHeight].every((value) => Number.isFinite(value) && value > 0)) return null;
|
||||
const scale = Math.min(maxWidth / sourceWidth, maxHeight / sourceHeight);
|
||||
return {
|
||||
width: Math.max(1, Math.floor(sourceWidth * scale)),
|
||||
height: Math.max(1, Math.floor(sourceHeight * scale)),
|
||||
};
|
||||
}
|
||||
|
||||
interface UseWebClientScreenShareOptions {
|
||||
streams: ScreenShareStream[];
|
||||
viewing: Ref<boolean>;
|
||||
|
||||
@@ -21,12 +21,16 @@ test("built-in appearance manifests and catalog versions match the bundled share
|
||||
for (const manifest of [lightManifest, darkManifest]) {
|
||||
assert.equal(BUILTIN_SKIN_CATALOG.find((skin) => skin.id === manifest.id)?.version, manifest.version);
|
||||
}
|
||||
assert.equal(lightManifest.version, "1.0.1");
|
||||
assert.equal(darkManifest.version, "1.0.1");
|
||||
assert.equal(lightManifest.version, "1.0.2");
|
||||
assert.equal(darkManifest.version, "1.0.2");
|
||||
assert.match(lightCss, /\.screen-share-live-indicator\s*\{[^}]*background:/s);
|
||||
assert.match(lightCss, /\.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(darkCss, /\.screen-share-live-indicator\s*\{[^}]*background:/s);
|
||||
assert.match(darkCss, /\.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(lightCss, /screen-player\.stage"\] \{ background: #000; \}/);
|
||||
assert.match(lightCss, /screen-player\.video"\] \{ object-fit: contain; background: #000; \}/);
|
||||
assert.match(darkCss, /screen-player\.stage"\] \{ background: #000; \}/);
|
||||
assert.match(darkCss, /screen-player\.video"\] \{ object-fit: contain; background: #000; \}/);
|
||||
});
|
||||
|
||||
test("skin catalog always includes protected built-ins and exposes only enabled custom skins", async () => {
|
||||
|
||||
@@ -9,7 +9,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: "builtin.light",
|
||||
name: "Day mode",
|
||||
version: "1.0.1",
|
||||
version: "1.0.2",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default light appearance.",
|
||||
@@ -21,7 +21,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: "builtin.dark",
|
||||
name: "Night mode",
|
||||
version: "1.0.1",
|
||||
version: "1.0.2",
|
||||
author: "WebSpeak",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "The default dark appearance.",
|
||||
@@ -33,7 +33,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_ILLUSIA_SKIN_ID,
|
||||
name: "ILLUSIA风",
|
||||
version: "2.0.1",
|
||||
version: "2.0.2",
|
||||
author: "WebSpeak Project",
|
||||
license: "All rights reserved",
|
||||
description: "A bright original-character art skin with a safe declarative live-channel badge.",
|
||||
@@ -46,7 +46,7 @@ export const BUILTIN_SKIN_CATALOG: SkinCatalogEntry[] = [
|
||||
{
|
||||
id: BUILTIN_KAAK_SKIN_ID,
|
||||
name: "KAAK",
|
||||
version: "3.1.73",
|
||||
version: "3.1.74",
|
||||
author: "WebSpeak Project",
|
||||
license: "AGPL-3.0-only",
|
||||
description: "A KOOK-inspired voice-room workspace with a searchable server header, TeamSpeak banner and welcome message, nested channel members, attached channel chat, and a compact WebSpeak audio dock.",
|
||||
|
||||
@@ -77,12 +77,23 @@ test("custom skins can override theme appearance without !important or private c
|
||||
);
|
||||
});
|
||||
|
||||
test("community skins use a scoped light fallback instead of inheriting the night skin", async () => {
|
||||
test("community skins use a scoped light fallback instead of inheriting the night skin", async () => {
|
||||
const lightCss = await readFile(new URL("../skins/builtin/light/skin.css", import.meta.url), "utf8");
|
||||
const scoped = scopeBuiltinThemeForCustomSkin(lightCss, "light", "community.illusia-voice");
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \{\s*color-scheme: light;/);
|
||||
assert.match(scoped, /:where\(\.ws-skin-root\[data-ws-skin="community\.illusia-voice"\]\) \.settings-content/);
|
||||
});
|
||||
});
|
||||
|
||||
test("built-in light and dark skins keep letterbox areas black", async () => {
|
||||
const [light, dark] = await Promise.all([
|
||||
readFile(new URL("../skins/builtin/light/skin.css", import.meta.url), "utf8"),
|
||||
readFile(new URL("../skins/builtin/dark/skin.css", import.meta.url), "utf8"),
|
||||
]);
|
||||
for (const [css, id] of [[light, "builtin.light"], [dark, "builtin.dark"]] as const) {
|
||||
assert.match(css, new RegExp(`data-ws-skin="${id}"[^{}]*\\[data-ws-part="voice\\.screen-player\\.stage"\\] \\{ background: #000; \\}`));
|
||||
assert.match(css, new RegExp(`data-ws-skin="${id}"[^{}]*\\[data-ws-part="voice\\.screen-player\\.video"\\] \\{ object-fit: contain; background: #000; \\}`));
|
||||
}
|
||||
});
|
||||
|
||||
async function componentSources(directory: string): Promise<string> {
|
||||
const componentRoot = new URL(directory, import.meta.url);
|
||||
@@ -141,7 +152,7 @@ test("the ILLUSIA v3 example and bundled package import without replacing WebSpe
|
||||
const skin = await importSkinPack(new File([exampleBytes], "illusia-voice.wskin", { type: "application/octet-stream" }));
|
||||
assert.equal(skin.id, "community.illusia-voice");
|
||||
assert.equal(skin.name, "ILLUSIA风");
|
||||
assert.equal(skin.version, "2.0.1");
|
||||
assert.equal(skin.version, "2.0.2");
|
||||
assert.equal(skin.schemaVersion, 3);
|
||||
assert.equal(skin.packageType, "open-skin");
|
||||
assert.equal(skin.layoutData, undefined);
|
||||
@@ -171,6 +182,8 @@ test("the ILLUSIA v3 example and bundled package import without replacing WebSpe
|
||||
assert.match(skin.css, /data-ws-plugin-part="illusia-now-playing\.channel-name"/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member\.live-indicator"\]\s*\{[^}]*border-color:[^}]*background:/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.member\.share-actions"\] \.screen-share-card-button\.viewing\s*\{[^}]*background:/s);
|
||||
assert.match(skin.css, /data-ws-part="voice\.screen-player\.stage"\]\s*\{[^}]*background: #000/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.screen-player\.video"\]\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(skin.css, /data-ws-part="home\.server-history\.item"/);
|
||||
assert.match(skin.css, /data-ws-part="home\.server-history\.favorite-toggle"\]\[data-ws-state="saved"\]/);
|
||||
assert.match(skin.css, /data-ws-part="voice\.favorite-servers\.favorite-toggle"\]\[data-ws-state="saved"\]/);
|
||||
@@ -225,8 +238,8 @@ test("the activity artwork layer floats above room content without intercepting
|
||||
assert.match(css, /:deep\(\.app-shell \.chat-panel \.section-heading\),[\s\S]*?:deep\(\.app-shell \.chat-panel \.message-composer\)\s*\{\s*position: relative;\s*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player\)?\s*\{[^}]*background: var\(--surface-1\)/);
|
||||
assert.match(css, /\.screen-share-player-exit\)?\s*\{[^}]*z-index: 3;/);
|
||||
assert.match(css, /\.screen-share-player-stage\)?\s*\{[^}]*var\(--accent\)[^}]*var\(--surface-2\)/);
|
||||
assert.match(css, /\.screen-share-player-video\)?\s*\{[^}]*background: var\(--surface-2\)/);
|
||||
assert.match(css, /\.screen-share-player-stage\)?\s*\{[^}]*background: #000/);
|
||||
assert.match(css, /\.screen-share-player-video\)?\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(css, /@media \(min-width: 741px\)\s*\{\s*\/\* Keep header menus above the independently stacked screen-share stage\. \*\/\s*\.app-shell \.workspace-header\s*\{\s*position: relative;\s*z-index: 40;/);
|
||||
});
|
||||
|
||||
@@ -466,7 +479,7 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
const file = new File([archive], "kaak-voice.wskin", { type: "application/octet-stream" });
|
||||
const skin = await importSkinPack(file);
|
||||
assert.equal(skin.id, "community.kaak-voice");
|
||||
assert.equal(skin.version, "3.1.73");
|
||||
assert.equal(skin.version, "3.1.74");
|
||||
assert.equal(BUILTIN_SKIN_CATALOG.find((entry) => entry.id === skin.id)?.version, skin.version);
|
||||
assert.equal(skin.schemaVersion, 3);
|
||||
const home = skin.pluginData?.components.find((component) => component.page === "home");
|
||||
@@ -695,6 +708,8 @@ test("the distributable KAAK package provides full home and voice surfaces", asy
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.voice-card[\s\S]*?aspect-ratio: 1\.82;/);
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.screen-share-live-indicator[\s\S]*?background: #20251e;/);
|
||||
assert.match(skin.css, /kaak-workspace\.member-cards[\s\S]*?\.screen-share-card-button\.viewing[\s\S]*?background: #8be31e;/);
|
||||
assert.match(skin.css, /kaak-workspace"\] \[data-ws-part="voice\.screen-player\.stage"\]\s*\{[^}]*background: #000/);
|
||||
assert.match(skin.css, /kaak-workspace"\] \[data-ws-part="voice\.screen-player\.video"\]\s*\{[^}]*object-fit: contain;[^}]*background: #000/);
|
||||
assert.match(skin.css, /@keyframes ws-community-kaak-voice-kaak-member-speaking-wave/);
|
||||
assert.ok(skin.css.includes("animation: ws-community-kaak-voice-kaak-performance-refresh-spin .72s linear infinite;"));
|
||||
assert.ok(skin.css.includes("performance-refresh:disabled .ui-icon { animation: none; }"));
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"id": "builtin.dark",
|
||||
"name": "WebSpeak Dark",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"author": "WebSpeak",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "The built-in dark appearance for public WebSpeak pages.",
|
||||
|
||||
@@ -277,6 +277,8 @@
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] *::-webkit-scrollbar-thumb:hover { background: #69c7bc; }
|
||||
|
||||
/* Keep live screen sharing obvious in the built-in dark voice roster. */
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] [data-ws-part="voice.screen-player.stage"] { background: #000; }
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] [data-ws-part="voice.screen-player.video"] { object-fit: contain; background: #000; }
|
||||
.ws-skin-root[data-ws-skin="builtin.dark"] .screen-share-live-indicator {
|
||||
color: #bdfff1;
|
||||
border-color: rgba(105, 210, 199, .48);
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"schemaVersion": 1,
|
||||
"id": "builtin.light",
|
||||
"name": "WebSpeak Light",
|
||||
"version": "1.0.1",
|
||||
"version": "1.0.2",
|
||||
"author": "WebSpeak",
|
||||
"license": "AGPL-3.0-only",
|
||||
"description": "The built-in light appearance for public WebSpeak pages.",
|
||||
|
||||
@@ -150,6 +150,8 @@
|
||||
}
|
||||
|
||||
/* Keep live screen sharing obvious in the built-in light voice roster. */
|
||||
.ws-skin-root[data-ws-skin="builtin.light"] [data-ws-part="voice.screen-player.stage"] { background: #000; }
|
||||
.ws-skin-root[data-ws-skin="builtin.light"] [data-ws-part="voice.screen-player.video"] { object-fit: contain; background: #000; }
|
||||
.ws-skin-root[data-ws-skin="builtin.light"] .screen-share-live-indicator {
|
||||
color: #075f56;
|
||||
border-color: #a9d8d0;
|
||||
|
||||
@@ -7158,7 +7158,7 @@
|
||||
box-sizing: border-box;
|
||||
place-items: center;
|
||||
overflow: hidden;
|
||||
background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--accent) 12%, var(--surface-1)), var(--surface-2) 74%);
|
||||
background: #000;
|
||||
}
|
||||
|
||||
:deep(.screen-share-player-video) {
|
||||
@@ -7168,7 +7168,7 @@
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: contain;
|
||||
background: var(--surface-2);
|
||||
background: #000;
|
||||
}
|
||||
|
||||
:deep(.screen-share-player-placeholder) {
|
||||
|
||||
@@ -6,11 +6,11 @@ import vue from "@vitejs/plugin-vue";
|
||||
import { createServer } from "vite";
|
||||
import { createRenderer, createSSRApp, nextTick, shallowRef, markRaw } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
let vite, useWebClientScreenShare, calculateScreenSharePlayerSize, VoiceMemberCards;
|
||||
let vite, useWebClientScreenShare, VoiceMemberCards;
|
||||
const renderer = createRenderer({ createComment: text => ({ text }), createText: text => ({ text }), createElement: () => ({}), insert() {}, remove() {}, setText() {}, setElementText() {}, patchProp() {}, parentNode: () => null, nextSibling: () => null });
|
||||
before(async () => {
|
||||
vite = await createServer({ configFile: false, plugins: [vue()], root: fileURLToPath(new URL("../", import.meta.url)), server: { middlewareMode: true, hmr: false, ws: false, watch: null }, optimizeDeps: { noDiscovery: true, include: [] }, appType: "custom" });
|
||||
({ useWebClientScreenShare, calculateScreenSharePlayerSize } = await vite.ssrLoadModule("/src/composables/useWebClientScreenShare.ts"));
|
||||
({ useWebClientScreenShare } = await vite.ssrLoadModule("/src/composables/useWebClientScreenShare.ts"));
|
||||
({ default: VoiceMemberCards } = await vite.ssrLoadModule("/src/components/web-client/VoiceMemberCards.vue"));
|
||||
});
|
||||
after(async () => { await vite?.close(); });
|
||||
@@ -41,18 +41,19 @@ test("a newly mounted or replaced video receives the existing stream and volume"
|
||||
} finally { f.app.unmount(); }
|
||||
});
|
||||
|
||||
test("screen-share player dimensions follow source orientation and stay inside the viewport bounds", () => {
|
||||
assert.deepEqual(calculateScreenSharePlayerSize(1080, 1920, 1100, 720), { width: 405, height: 720 });
|
||||
assert.deepEqual(calculateScreenSharePlayerSize(1920, 1080, 1100, 720), { width: 1100, height: 618 });
|
||||
assert.equal(calculateScreenSharePlayerSize(0, 1080, 1100, 720), null);
|
||||
});
|
||||
|
||||
test("screen-share player keeps a visible fallback width while video metadata is pending", async () => {
|
||||
test("screen-share player keeps a fixed 16:9 stage and letterboxes other video ratios in black", async () => {
|
||||
const css = await readFile(new URL("../src/styles/web-client.css", import.meta.url), "utf8");
|
||||
const component = await readFile(new URL("../src/components/web-client/ScreenSharePlayer.vue", import.meta.url), "utf8");
|
||||
const playerRule = css.match(/:deep\(\.screen-share-player\)\s*\{([^}]*)\}/)?.[1] ?? "";
|
||||
const stageRule = css.match(/:deep\(\.screen-share-player-stage\)\s*\{([^}]*)\}/)?.[1] ?? "";
|
||||
const videoRule = css.match(/:deep\(\.screen-share-player-video\)\s*\{([^}]*)\}/)?.[1] ?? "";
|
||||
assert.match(playerRule, /width:\s*min\(100%,\s*1100px\)/);
|
||||
assert.doesNotMatch(playerRule, /width:\s*fit-content/);
|
||||
assert.match(stageRule, /aspect-ratio:\s*16\s*\/\s*9/);
|
||||
assert.match(stageRule, /background:\s*#000/);
|
||||
assert.match(videoRule, /object-fit:\s*contain/);
|
||||
assert.match(videoRule, /background:\s*#000/);
|
||||
assert.doesNotMatch(component, /video\.video(?:Width|Height)/, "source dimensions must not resize the fixed player stage");
|
||||
assert.doesNotMatch(component, /ResizeObserver/, "player sizing must not create a resize-feedback loop while video starts");
|
||||
assert.match(component, /if \(playerElement\.value === next\) return;/, "stable function refs must not rewrite player styles on every render");
|
||||
assert.match(component, /if \(stageElement\.value === next\) return;/, "stable function refs must not rewrite stage styles on every render");
|
||||
|
||||
Reference in new issue
Block a user