feat: 为 docPIP 画中画窗口添加最小化按钮#180
Open
gcfkhy wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
做了什么
在 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.ts、src/shim.消息及类型。测试
pnpm build通过;eslint 通过。