Files
FruitServer/docs/plans/INBOX.md
T

66 lines
3.6 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# INBOX
## [已处理] K77-A 视频未就绪不再显示封面,改由进度条表示加载
### 需求
1. 视频还没加载出来时**不显示封面**,视频区保持纯黑。
2. 加载中(首帧未就绪 / 中途 network buffering)用**进度条本身**做加载状态:
轨道上跑一段主题色高光,不要静态空进度条。
### 现状
- `lib/pages/player/widgets/player_video_surface.dart`
- `_FallbackBackground` 会渲染 `RemoteImage(posterUrl)` + 黑色遮罩(key `player-fallback-cover` / `player-fallback-scrim`)
- `player_view.dart` 传入 `posterUrl: drama.posterUrl`
- `lib/pages/player/widgets/home_feed_overlay_parts.dart` `_FeedProgressBar`
- 控制器为空时画一条 0 进度的空轨道;播放中也没有 buffering 态
- `lib/pages/player/widgets/seek_progress_bar.dart`(全屏播放页进度条)
- 未初始化时 `Slider` 处于 disabled,静态空轨道;没有 buffering 态
### 实现
1. **去掉封面占位**
- `PlayerVideoSurface` 删除 `posterUrl` 参数与 `_FallbackBackground` 里的 `RemoteImage` / 遮罩,
未就绪时只渲染纯黑 `ColoredBox`(保留 key `player-fallback-background`)
- 删除不再需要的 `remote_image.dart` 引用
- `player_view.dart` 调用处去掉 `posterUrl:`
2. **新增公共加载轨道** `lib/pages/player/widgets/loading_progress_track.dart`
- `LoadingProgressTrack({required double height, Color trackColor = Colors.white24, Color highlightColor = AppColors.blue, Key? key})`
- 轨道铺满宽度;一段约 28% 宽的主题色高光从左到右循环滑动
(`AnimationController` 1200ms `repeat()`,`Curves.easeInOut`)
- 整体挂 `Key('progress-loading')`,高度与所在进度条一致,避免布局跳动
3. **首页 feed 进度条**(`_FeedProgressBar`)
- `controller == null` → 直接渲染 `LoadingProgressTrack`(高度 `widget.height`,外层保持 `hitHeight` 手势区),不显示滑块/拇指
- 播放中 `value.isBuffering == true` → 同样渲染加载轨道(隐藏已播进度与白色圆点)
- 其余情况保持现有可拖动进度条
4. **全屏播放页进度条**(`SeekProgressBar._buildTrack`)
- `!video.isInitialized || video.isBuffering` → 用 `LoadingProgressTrack` 替换 `Slider`
(高度沿用 compact/普通两种非拖动高度,隐藏时间文案)
- 其余情况保持现有 Slider 与拖动逻辑
### 测试
- 更新 `test/player/player_video_surface_test.dart`、`test/player/player_fullscreen_test.dart`:
不再断言 `player-fallback-cover` / `player-fallback-scrim`,改为断言 `player-fallback-background` 为纯黑
- 新增 `test/player/loading_progress_track_test.dart`:渲染后存在 `progress-loading`,pump 一段时间后动画仍在运行(可用 `tester.pump` 两次断言位置变化)
- `SeekProgressBar` 增加用例:`valueListenable == null` 或 buffering 值时出现 `progress-loading`,正常播放时出现 `Slider`
### 验收
- 门禁:`dart analyze lib test` 零告警、`flutter test` 全过、`flutter build apk --debug` 成功。
- 真机自查:冷启动进入 feed 时视频区纯黑、底部进度条有高光跑动;弱网卡顿时进度条切回高光跑动。
### Git
- 从 `develop` 拉 `feat/progress-loading-state`。
- 提交:`feat(player): 未就绪改由进度条展示加载态`,作者 `Zhou Weidong <502333560@qq.com>`。
- `--no-ff` 合回 `develop` 并 push;`FruitServer/docs/plans/PROGRESS.md` 追加 K77-A 留痕。
### 约束
- 全程中文;禁止 `git add -A`;不改其它页面与交互;完成后停住等待验收。