播放器:退出全屏后再次进入全屏时,画面中央误弹「全屏播放」浮钮,点击后直接退回竖屏
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 86/100
Research direction
Start in PlayerControlsOverlay.kt at the floating button visibility condition around line 782; the issue identifies the missing fullscreen state check. Add the reported condition and review the surrounding control logic. Done means the button appears only in portrait windowed playback of a landscape video, and the issue’s repeat-entry steps no longer show it or return playback to portrait when tapped.
Written by the indexing model from the issue text.
Description
环境
- 设备:红米note12tpro android12
- 系统自动旋转:开启
- Piko 版本:1.3
- 来源:GitHub Release(APK)
复现步骤
- 竖屏状态下打开一个横版视频(正常进入竖屏播放页)
- 点右下角全屏按钮 → 正常横屏全屏(第一次没有问题)
- 退出全屏,回到竖屏播放页
- 再次点右下角全屏按钮进入全屏
- 叠加条件(更容易触发):在第 3、4 步之间手动把手机横过来再转回竖屏一次
- 画面中央弹出「全屏播放」浮钮(此时已经在全屏中,不该出现)
- 点击该浮钮 → 播放器退回竖屏,行为与按钮文案完全相反
期望行为
已处于全屏状态时,「全屏播放」浮钮不应出现;它只应在"竖屏窗口 + 横版视频 + 未全屏"时作为快捷入口。
原因分析(供参考)
全屏有两套独立的状态来源,浮钮只参考了其中一套:
MediampVideoPlayerScreen.kt:127用rememberSaveable维护isFullscreen,:131-138的 enter/exitFullscreen 通过requestedOrientation = SENSOR_LANDSCAPE/resetOrientation()控制方向;PlayerControlsOverlay.kt:201的isLandscape来自LocalWindowInfo.current.containerSize的实时测量(:197),与isFullscreen无关联。
浮钮的可见条件在 PlayerControlsOverlay.kt:782:
visible = !isLocked && !isLandscape && isLandscapeVideo == true && errorMessage == null && !isEditingCropRegion
其中没有检查 !isFullscreen(该参数在 :158 已经存在并传入)。第二次进入全屏时,窗口尺寸的更新滞后或方向未随 SENSOR_LANDSCAPE 立即翻转(横屏有左右两种朝向、退出全屏后方向已交还传感器),!isLandscape 短暂甚至持续成立,浮钮便在全屏画面上误弹。此时点击它走的是同一个切换入口(MediampVideoPlayerScreen.kt:461):isFullscreen == true → 执行 exitFullscreen → 退回竖屏。
PlayerControlsOverlay.kt:121-122 的注释写明「[isLandscapeVideo] 决定竖屏时是否给出全屏入口」,但该入口显然也应排除已全屏的情形。
修复建议
在 PlayerControlsOverlay.kt:782 的 visible 条件里补上 !isFullscreen:
visible = !isFullscreen && !isLocked && !isLandscape && isLandscapeVideo == true && errorMessage == null && !isEditingCropRegion
一行即可消除误弹与点击后的语义反转。顺带可以考虑:既然 Issue #30 之后全屏已由 isFullscreen 显式表达,浮钮条件里以 isFullscreen 为准比依赖窗口实测尺寸更稳(实测尺寸在旋转过渡期与传感器朝向歧义时不可靠)。
备注
问题只在第二次及以后进入全屏时出现,第一次全屏方向链路干净,两个状态源同步,故不复现。
- Dominant language
- Kotlin
- Stars
- 305
- Forks
- 3
- Avg merge
- 9m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from NihilDigit/piko
-
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
NihilDigit/piko#34 · 1 comment ·
-
Difficulty 3/5 1-2 days Newbie friendliness 53/100
NihilDigit/piko#33 · 1 comment ·
-
mac版本播放视频会卡死Open
Difficulty 4/5 1-2 days Newbie friendliness 52/100
NihilDigit/piko#32 · 1 comment ·
-
搜索和重命名bugOpen
Difficulty 4/5 3-5 days Newbie friendliness 18/100
NihilDigit/piko#27 · 2 comments · 2 reactions ·
-
不能正常登录Open
Difficulty 3/5 1-2 days Newbie friendliness 25/100
NihilDigit/piko#26 · 3 comments ·
Similar issues
-
[Request] 李跳跳Openrequest-adaption
Difficulty 2/5 Under an hour Newbie friendliness 78/100
BetterAndroid/android-notification-icon-project#799 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 1/5 Under an hour Newbie friendliness 90/100
ProdigyV21/ARVIO#832 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
SIGSEGV in symex on __builtin_constant_p of a void expressionPossibly taken A pull request linked to this issue is open or already merged. Openbug goto-symex
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 1 day