You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Rodger-Wang
8841e76e59
修 iOS 多媒体翻译开弹幕后整屏点不动
三段代码叠出来的,安卓不受影响(走的是系统悬浮窗,另一条路):
1. pip 包(pub: pip 0.0.4)在 PiP 启动回调里,把 contentView insertSubview 进
**App 自己的 keyWindow** 并 `frame = window.frame` 铺满全屏。它的
activeKeyWindow 只按「前台活跃场景的 keyWindow」找父视图,而我们是在前台
主动 _pip.start() 的,于是必然落到 App 自己的窗口上。
2. PlayerView 是普通 UIView,isUserInteractionEnabled 默认 YES,背景还是
rgba(40,40,40,0.35)。铺满之后=一层吃掉所有触摸的半透明黑罩子。
3. 关掉弹幕也恢复不了:插件的 restoreContentViewIfNeeded 在
originalParentView == nil 时直接 return,而 PlayerView 是 createPipContentView
里凭空 new 出来的、从来没有过 superview,那条还原分支永远走不到。
罩子会一直留到进程被杀。
改动(都在我们自己这边,没有 fork pub 包):
- PlayerView.isUserInteractionEnabled = false。字幕卡片是纯展示,任何情况下
都不该吃触摸——这一条单独就能解掉「点不动」。
- 视觉(底色/圆角/描边/阴影)从 self 搬到内层 cardView,self 透明;
cardView 只钉 top/leading/trailing + 固定高度,不钉 bottom。真 PiP 小窗里
窗口高度就等于这个高度、看着是铺满的;万一又被铺到全屏窗口上,也只占顶部
一条,下面保持透明。
- disposePipContentView 里补 removeFromSuperview(插件不会替我们摘)。
- Dart 关闭弹幕/PiP 失败时调 _releasePipContentView(),并把 _pipContentView
清零,避免复用一个已经被搬走、再也摘不下来的 view。
⚠️ 未验证:PiP 小窗本身能不能正确显示字幕。pip 包的 PipView 只往
sampleBufferDisplayLayer 里塞自己造的 buffer,全文件没有一处引用 contentView,
所以「切出 App 后小窗里有没有字」这件事需要真机确认,本次没测。
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
1 month ago |
| .. |
|
core
|
闹钟改成只在 App 内提示;通话翻译/通话录音挂前台服务;复刻档位日志提到 warn
|
1 month ago |
|
data
|
闹钟改成只在 App 内提示;通话翻译/通话录音挂前台服务;复刻档位日志提到 warn
|
1 month ago |
|
modules
|
修 iOS 多媒体翻译开弹幕后整屏点不动
|
1 month ago |
|
routes
|
收拢积压改动:恒玄 OTA、发版配置拆表、实名认证、芯片厂商/代工厂管理等
|
1 month ago |
|
firebase_options.dart
|
apps/client 首次入库(Flutter 移动端)
|
1 month ago |
|
main.dart
|
apps/client 首次入库(Flutter 移动端)
|
1 month ago |