Skip to content

feat: 为 docPIP 画中画窗口添加最小化按钮#180

Open
gcfkhy wants to merge 1 commit into
apades:mainfrom
gcfkhy:docpip-minimize-button
Open

feat: 为 docPIP 画中画窗口添加最小化按钮#180
gcfkhy wants to merge 1 commit into
apades:mainfrom
gcfkhy:docpip-minimize-button

Conversation

@gcfkhy

@gcfkhy gcfkhy commented Jul 1, 2026

Copy link
Copy Markdown

做了什么

在 docPIP 播放器右下角控制栏新增一个最小化按钮。点击后:

  • 通过 chrome.windows.update(windowId, { state: 'minimized' }) 将画中画窗口最小化到任务栏;
  • 同时暂停源视频。

仅在 docPIP 模式下显示(canvas / replacer 模式没有独立窗口)。

为什么

documentPictureInPicture 窗口是置顶的、且没有内置的最小化按钮,之前想把它收起来放到任务栏,只能关闭窗口,没有别的办法。

实现

  • src/components/VideoPlayerV2/bottomPan 的控制栏按钮,写法参照现有的ResizeButton;点击时暂停源视频并发送 minimizeDocPIP` 消息。
  • src/background/docPIP.ts —— 处理 min 态设为 minimized,复用现有的mv3GetDocPIPTab/mv3UpdateTab` 窗口控制逻辑。
  • src/shared/webextEvent.tssrc/shim. 消息及类型。

测试

  • pnpm build 通过;eslint 通过。
  • 已在 Windows 上实测:点击按钮后画中画窗口最小化到任务栏、源视频暂停,并可从任务栏恢复窗口。

Minimizes the docPIP window via chrome.windows.update(state:minimized) and pauses the source video on click. The button lives in the bottom-right control group and is shown in docPIP mode only.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

能否加一个快捷键类的功能,摸鱼用 悬浮窗取消置顶和最小化功能的问题

1 participant