fix(ui): keep playback state and floating controls consistent
Native original-page readiness now reaches the existing participant projection. Narrow playback gives time priority over the inline volume slider. Floating panels join room Back handling after their document adoption so return from picture-in-picture remains dismissible. Checked actual touch controls and PiP return in Chrome, focused playback and panel suites, and both TypeScript projects.
This commit is contained in:
1 parent
dc94bda30b
commit
9c6e2e129b
7 files changed
+36
-14
No files matched your search
@@ -221,7 +221,7 @@ its public rooms. Use the same
|
||||
browser profile to retain your existing identity; private/incognito profiles
|
||||
have separate saved credentials.
|
||||
|
||||
If Piik asks you to refresh, reload the page. If it asks you to update the
|
||||
If Piik asks you to refresh, click **Refresh page**. If it asks you to update the
|
||||
site, contact the administrator who runs its Piik App or Server.
|
||||
|
||||
### The page opens but the site will not connect
|
||||
@@ -252,9 +252,6 @@ your 3.0 test and restart it. If it asks you to refresh, reload the page. If
|
||||
the page still needs an update, contact the site administrator. Then select
|
||||
**App** again.
|
||||
|
||||
If you are using an earlier beta with the old handshake, ask
|
||||
the site administrator for the App package from that candidate.
|
||||
|
||||
## Chat and files
|
||||
|
||||
### Chat or history will not load
|
||||
|
||||
@@ -178,7 +178,7 @@ Piik App 的本地网络邀请使用临时自签名 HTTPS 证书,浏览器可
|
||||
房间邀请被拒绝不会妨碍你继续使用站点或进入公开房间。
|
||||
使用原浏览器配置可保留已有身份;隐私模式或另一浏览器配置使用各自保存的凭据。
|
||||
|
||||
如果 Piik 提示刷新,请重新加载页面。如果提示更新站点,请联系站点管理员更新托管站点的 App 或 Server。
|
||||
如果 Piik 提示刷新,请点击 **刷新页面**。如果提示更新站点,请联系站点管理员更新托管站点的 App 或 Server。
|
||||
|
||||
### 网页能打开但站点连接不上
|
||||
|
||||
@@ -201,8 +201,6 @@ Piik App 的本地网络邀请使用临时自签名 HTTPS 证书,浏览器可
|
||||
如果 Piik 提示更新 App,请安装本次 3.0 内测提供的最新版并重启 App。如果提示刷新,请重新加载页面。
|
||||
如果页面仍提示需要更新,请联系站点管理员。完成后再次点击 **App**。
|
||||
|
||||
如果还在使用采用旧握手的内测站点,请向站点管理员索取同一内测批次的 App。
|
||||
|
||||
## 聊天与文件
|
||||
|
||||
### 聊天或历史记录加载不出来
|
||||
|
||||
@@ -83,7 +83,6 @@
|
||||
.c3-watch-position { display: flex; align-items: center; gap: 6px; min-width: 0; padding-inline: 2px; font-size: 12px; line-height: 1.2; }
|
||||
.c3-watch-status { display: inline-flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; font-weight: 650; }
|
||||
.c3-watch-time { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-variant-numeric: tabular-nums; }
|
||||
.c3-watch-time[data-live] { white-space: normal; text-overflow: clip; }
|
||||
.c3-watch-position[data-seeking] .c3-watch-time { color: var(--action); }
|
||||
.c3-mini-player[data-thumbnail] .c3-mini-controls > :is(.lr-chat-overlay-toggle, .lr-remote-controls),
|
||||
.c3-mini-player[data-thumbnail] .c3-mini-controls:not(.c3-watch-controls) .lr-playback-window { display: none; }
|
||||
@@ -135,8 +134,8 @@
|
||||
.c3-mini-controls { --mini-controls-inset: 2px; width: calc(100% - 2 * var(--mini-controls-inset)); gap: 0; padding: 2px; }
|
||||
.c3-mini-controls .c3-mini-space { display: none; }
|
||||
}
|
||||
@container (max-width: 256px) {
|
||||
/* Keep the direct actions readable in the smallest tiles. */
|
||||
@container (max-width: 440px) {
|
||||
/* Keep time and direct actions readable before exposing the volume slider. */
|
||||
.c3-watch-inline-volume { display: none; }
|
||||
.c3-watch-volume { display: grid; }
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export interface ParticipantActivity {
|
||||
}
|
||||
interface LocalWatchPresentation {
|
||||
sessionId: string | null;
|
||||
watchPlayers: ReadonlyMap<string, Pick<WatchPlayer, "blocked" | "waitingForPicture" | "hasPresentedFrame" | "error">>;
|
||||
watchPlayers: ReadonlyMap<string, Pick<WatchPlayer, "blocked" | "waitingForPicture" | "hasPresentedFrame" | "hasReadyOriginalPage" | "error">>;
|
||||
}
|
||||
export const viewingAppearance = {
|
||||
joined: { icon: "clapperboard", label: "watch.joined", rank: 0 },
|
||||
@@ -87,7 +87,7 @@ function watchViewerState(watch: WatchActivity, sessionId: string, local?: Local
|
||||
if (player?.error) return "failed";
|
||||
if (player?.blocked) return "joined";
|
||||
if (player?.waitingForPicture) return "preparing";
|
||||
return player?.hasPresentedFrame ? "active" : "joined";
|
||||
return player?.hasPresentedFrame || player?.hasReadyOriginalPage ? "active" : "joined";
|
||||
}
|
||||
|
||||
function takesViewingPriority(next: ParticipantViewing, current?: ParticipantViewing): boolean {
|
||||
|
||||
@@ -43,6 +43,9 @@ export class WatchPlayer {
|
||||
const required = media.paused || media.ended ? HAVE_CURRENT_DATA : HAVE_FUTURE_DATA;
|
||||
return media.readyState < required || Boolean(video && video.videoWidth > 0 && !this.hasPresentedFrame);
|
||||
}
|
||||
get hasReadyOriginalPage(): boolean {
|
||||
return !this.video && !!this.media.page && !this.waitingForPicture;
|
||||
}
|
||||
presentFrame(): void {
|
||||
if (this.signal.aborted || this.presented) return;
|
||||
this.presented = true; this.changed();
|
||||
|
||||
@@ -3,6 +3,7 @@ import { useImperativeHandle, useLayoutEffect, useRef, useState, type PointerEve
|
||||
import { createPortal } from "react-dom";
|
||||
import { useCopy } from "../../ui/copy";
|
||||
import { Glyph } from "../../ui/icons";
|
||||
import { useLayerHistory } from "../../ui/layer-history";
|
||||
import { surfaceViewport } from "../../ui/window-appearance";
|
||||
import { usePanelWindow, panelWindowAPI, SurfaceDocument, PANEL_SIZE } from "../../ui/panel-window";
|
||||
import { Btn } from "./primitives";
|
||||
@@ -121,6 +122,8 @@ export function FloatingPanel({ onDetachedTrigger, onNativeReady, closeOnReturn
|
||||
return () => owner.removeEventListener("fullscreenchange", hideOutsideFullscreen);
|
||||
}, [surfaceDocument]);
|
||||
|
||||
useLayerHistory(panelRef, open && !detached);
|
||||
|
||||
useLayoutEffect(() => {
|
||||
if (!surfaceDocument) return;
|
||||
if (surfaceDocument !== document) surfaceDocument.title = `${title} · Piik`;
|
||||
|
||||
@@ -12,7 +12,7 @@ import { firstUnreadMessageId, messageDateFormats, roomActivityPeople, roomPeopl
|
||||
import { messageSchema, snapshotSchema, watchActivitySchema } from "../src/client/channel/protocol";
|
||||
import { say, t, type CopyKey } from "../src/client/ui/copy";
|
||||
import { WatchPlayer } from "../src/client/channel/watch-playback";
|
||||
import type { WatchMedia } from "../src/client/channel/watch-media";
|
||||
import { AppPageMedia, type WatchMedia } from "../src/client/channel/watch-media";
|
||||
|
||||
const english = (key: CopyKey) => t("en", key);
|
||||
const chinese = (key: CopyKey) => t("zh", key);
|
||||
@@ -27,7 +27,7 @@ it("adds the date to a message timestamp across local midnight", () => {
|
||||
expect(formats.clock(message, new Date(2027, 0, 1))).toContain("2026");
|
||||
});
|
||||
|
||||
it("projects joined watch people independently of transport and deduplicates their endpoints", () => {
|
||||
it("projects joined watch people independently of transport and deduplicates their endpoints", async () => {
|
||||
const sessions = [["owner-page", "owner"], ["owner-app", "owner"], ["viewer-web", "viewer"], ["viewer-app", "viewer"], ["direct-web", "direct"], ["relay-endpoint", "relay"]];
|
||||
const activity = watchActivitySchema.parse({ id: "watch", roomId: "room", sessionId: "owner-page", userId: "owner",
|
||||
source: { kind: "website", url: "https://video.test/watch" }, playback: { timeline: "media" as const, position: 0, paused: true, rate: 1, anchorTime: 0 },
|
||||
@@ -86,6 +86,28 @@ it("projects joined watch people independently of transport and deduplicates the
|
||||
expect(viewing("viewer")).toBe("failed");
|
||||
expect(localViewing()).toBe("failed");
|
||||
} finally { player.close(); }
|
||||
let sample = { position: 0, paused: true, rate: 1, duration: 10, readyState: 1, ended: false, buffered: null };
|
||||
const page = new AppPageMedia({ id: "native-page", selectedCandidateId: "native-video", read: async () => sample,
|
||||
patch: async () => {}, listen: () => () => {}, focus: async () => {}, close() {} });
|
||||
const originalPlayer = new WatchPlayer("room", false, page, () => {});
|
||||
local.watchPlayers.set("watch", originalPlayer);
|
||||
state.watchActivities[0].viewerSessionIds = ["viewer-web", "direct-web"];
|
||||
try {
|
||||
originalPlayer.calibrate(0, performance.now());
|
||||
originalPlayer.update(activity.playback);
|
||||
await originalPlayer.sample();
|
||||
expect(viewing("viewer")).toBe("preparing");
|
||||
expect(localViewing()).toBe("preparing");
|
||||
sample = { ...sample, readyState: 4 };
|
||||
await originalPlayer.sample();
|
||||
expect(viewing("viewer")).toBe("active");
|
||||
expect(localViewing()).toBe("active");
|
||||
expect(viewing("direct")).toBe("joined");
|
||||
sample = { ...sample, readyState: 2, ended: true };
|
||||
await originalPlayer.sample();
|
||||
expect(viewing("viewer")).toBe("active");
|
||||
expect(localViewing()).toBe("active");
|
||||
} finally { originalPlayer.close(); }
|
||||
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user