Repository navigation
fix(video): 旋转⇄转回横向时按钮降档随实宽重估(#1844 复测) - #1965
Merged
Merged
Conversation
根因:refitForRotation 只清样式 + autoSize(),从不重跑 applyCompact;容器尺寸旋转前后不变(ResizeObserver 不触发),Artplayer autoSize 只 emit autoSize 不 emit resize → compact 档位跨旋转滞留(旋转态窗口 resize 置位缩小档后转回横向,按钮不恢复全尺寸)。两分支末尾统一补跑 applyCompact()。测试:e2e/video-fit.spec.ts 新增旋转降档重估用例(临时注释修复时用例失败,可区分修复前后)。fixes #1844
This was referenced Dec 2, 2026
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.
问题(#1844 复测残留)
用户复测:画面旋转后能自动适配(#1963 有效);再旋转成横向,按钮大小未自动适配横向宽度——按钮停在缩小档。
根因
refitForRotation(旋转 ⇄ 转回的唯一入口)只清样式 +art.autoSize(),从不重跑applyCompact。$player实宽(旋转态收窄成纵向框 / 转回恢复宽框),但容器尺寸不变 →ResizeObserver不触发;ArtplayerautoSize()只 emitautoSize、不 emitresize→applyCompact无任何路径重跑,档位跨旋转滞留。scheduleFit在窄 player 上置位vp-ultra)→ 转回横向 → 档位滞留。修法
refitForRotation两分支末尾统一补跑applyCompact()。样式写入为同步,此处量到的已是过渡后布局。测试
e2e/video-fit.spec.ts新增「旋转 ⇄ 转回横向时按钮降档随实宽重估」:宽容器无降档 → 旋转后vp-ultra置位 → 转回后两档清除。临时注释修复时该用例失败(已验证可区分修复前后)。npx tsc --noEmit✓、npx vitest run2499 ✓、npx playwright test e2e/video-fit.spec.ts e2e/video-controls.spec.ts e2e/video-compact.spec.ts24 ✓风险
低——纯前端逻辑补跑既有降档函数,不改阈值与 CSS。WKWebView 无平台特有差异点。
fixes #1844