feat: release v0.1.2 with playback quality selection

This commit is contained in:
loveuer committed 2026-11-04 10:44:16 +08:00
1 parent 93f1221e6a
commit e8cd96eb5e
16 files changed
+598 -43

No files matched your search

+1
View File
@@ -12,5 +12,6 @@ The application has one Android app module and no backend service.
- `BulubuluHome`, dialogs and `TvAction` own TV layout/focus. Home stays composed beneath overlays, with focus/clicks disabled while inactive.
- `SearchScreen` uses the device IME and the existing card components. It stays composed beneath details/player and restores result focus independently of Home.
- `PlayerScreen` creates and releases Media3 with the composable lifecycle, merges separate AVC/AAC tracks and handles D-pad/media keys. CDN requests never receive account cookies.
- `PlaybackQualitySwitcher` owns manual quality changes and commits the selected label only when the replacement source is ready. It preserves position/play intent, rejects overlapping requests and attempts the original source once after failure. `playbackMediaSource` shares HTTP identity, backup CDN handling and track merging between initial playback and changes. `QualityDialog` scrolls to and focuses the current actual track; one ExoPlayer is retained throughout the screen lifecycle.
There is no analytics, self-update service, local media scanning or private server. Login credentials and signed playback URLs must never appear in application logs or raw error messages. Account entitlements and region/DRM restrictions remain server-controlled. Tests use fake sessions in isolated storage and do not require a real account.
+4
View File
@@ -13,6 +13,10 @@
播放请求按普通 Web 客户端获取服务端允许的视频流,优先选择不高于常规 1080P 的 H.264 与 AAC,适合已知的 32 位 ARM Android 11 电视。清晰度由实际返回的轨道决定,登录和会员权益仍以 B 站接口结果为准。HTTP 图片/CDN链接升级到 HTTPS。
播放接口使用 `qn=120`、`fnval=16`、`fourk=1` 请求账号可用的 DASH 档位,首次播放仍优先选择不高于普通 1080P 的轨道。请求高档位不会预先下载该档位媒体,也不会扩大账号权益。菜单按实际 `dash.video` 中的 H.264 轨道生成,同一清晰度的重复轨道取码率较高的一条,并保留官方备用地址;音频复用本次返回的 AAC 轨道。只有单文件 progressive 时只显示当前一档。
清晰度名称优先读取 `support_formats[].new_description`,其次读取 `accept_description`,最后使用已知档位名称。`accept_quality` 和 `support_formats` 仅供描述,不能证明账号实际拿到了对应视频流。2026-11-04 匿名只读探测中,响应曾声明 1080P 高码率、1080P、720P 等档位,但实际 H.264 视频只有 480P / 360P;菜单据此只提供这两档。非 H.264、无有效 HTTPS 地址的轨道不会成为选项,会员、试看和 DRM 检查保持原有处理。
获取播放地址和下载音视频必须共用 `BiliHttpClient.USER_AGENT`。播放器的独立 HTTP 数据源由 `mediaHttpDataSourceFactory` 创建,携带内容 Referer,保留 Range 请求,不携带账号 Cookie。2026-11-04 目标电视对照验证:旧 Android 播放器标识使多个 CDN 返回 HTTP 403;同一批地址改用接口的浏览器标识后,三个视频地址及三个音频地址均可读取 MP4 数据。
`PlaybackNetworkDiagnosticTest` 提供显式启用的真实网络诊断,默认测试不访问外部服务。它使用独立匿名内存会话,比较旧标识和生产数据源,仅报告 CDN 主机、状态码和媒体文件头,不读取用户登录状态,不输出 Cookie 或带签名的完整地址。
+2 -1
View File
@@ -10,7 +10,8 @@ At a typical 960 × 540 dp TV viewport, the home screen has 38 dp horizontal and
- Search: the header entry opens a separate screen while preserving Home. Confirm on the text field opens the system IME; its Search action, Enter, or the explicit search button submits. Typing alone never requests results. Down moves to the selected video/movie/bangumi filter, then into the four/five-column result grid. Results use the existing details/episode/player flow. Back first hides the keyboard, then returns from the grid to the selected filter, then closes search. Clear returns to the input. Closing clears the transient query and results; there is no search history.
- Details: first episode receives focus after loading. Confirm starts playback. Multi-part videos and series have an episode grid. Back closes the dialog.
- Login: QR code is generated locally with ZXing, not uploaded to a QR service. Refresh and close are D-pad targets. Closing cancels the parent-owned poll task. No password input is present.
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up/down display controls. Back exits playback directly. Both key-down and key-up are consumed so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error and hide after four seconds during playback.
- Player: confirm or play/pause toggles playback; left/right seek ten seconds, with long press throttled to one step per 250 ms. Up reveals controls and focuses the top-right quality action; confirm opens its menu. Down returns focus to the video. Back exits playback directly. Both key-down and key-up are consumed so Android PlayerView cannot apply the same event twice. Controls remain visible when paused/end/error, while the quality action is focused or while its menu is open, and otherwise hide after four seconds during playback.
- Quality menu: the current option is marked and receives focus, scrolling into view if necessary. Up/down navigate and confirm selects. Back/Close returns focus to the quality action. Only actual compatible tracks are shown; a single available option is explained. Changes briefly rebuffer at the same position and retain pause/play intent. An in-flight change disables duplicate selection; failure attempts the original quality once and reports recovery after it is ready. Choosing the current option closes without reloading. This is manual selection; each new video starts at the default quality and there is no automatic bitrate adaptation.
- App backgrounding pauses the player; foregrounding resumes only if it was previously playing. Leaving the player releases Media3 and screen-on state.
Search remains composed beneath details and playback, with focus/clicks disabled while inactive. Returning restores the selected result and scroll position. Load more retains its focus during the request, then moves focus to the first appended result. If the final page adds no items, focus returns to the last result. Empty, error, risk-control and loading states do not use placeholder search results.
+9 -1
View File
@@ -48,11 +48,19 @@
- 此次构建、55 项 JVM 测试和 Android Lint 通过。新增的真实网络诊断默认跳过,须传入 `livePlayback=true` 显式启用。
- 用户实测后确认播放恢复正常,并同意提交为 `v0.1.1`;应用版本号为 `0.1.1`,Android `versionCode` 递增为 `2`。
## v0.1.2 清晰度选择 — 2026-11-04
- 匿名官方播放接口探测确认可取得多档 DASH 视频流;`qn=120`、`fnval=16`、`fourk=1` 请求成功,但账号无权取得的档位仍不会返回。样本中的 `accept_quality` 声明了 1080P / 720P 等档位,实际 H.264 轨道只有 480P / 360P;菜单以实际轨道为准。
- 开发版构建、Android Lint 和 69 项 JVM 测试通过,0 失败。新增 6 项解析测试和 8 项切换状态测试,覆盖实际轨道与声明档位的区别、编码过滤、重复轨道、默认清晰度、备用地址、位置与暂停意图保持、就绪后才提交选择、重复请求隔离、失败恢复和关闭后迟到回调。
- Android 11 ARM64 模拟器的 14 项常规设备测试通过,0 失败;另有 1 项显式网络诊断按默认设置跳过。新增 3 项清晰度菜单测试验证当前档位焦点、方向键选择、长列表滚动、返回关闭以及切换期间禁止重复选择。
- 实际匿名投稿视频曾从 480P 切到 360P,画面和进度继续推进至 `00:42 / 03:31`。后续双向切换与暂停状态的完整复测未完成:模拟器出现绿屏、Codec2 超时和宿主图形缓冲错误,重新启动后的首次播放也能复现,尚未完成原因隔离。单元测试通过不代表真实解码、音画同步和所有清晰度已经端到端验证。
- 本轮 ADB 连接目标电视超时,未把本功能覆盖安装到电视;最终实机双向切换、暂停后切换和高档位解码仍待验证。用户决定先提交为 `v0.1.2`,晚上进行电视实机验证;应用版本号更新为 `0.1.2`,Android `versionCode` 递增为 `3`,既有 `v0.1.1` 标签保留。
## 复现
```sh
./gradlew assembleDebug testDebugUnitTest lintDebug
ANDROID_SERIAL=emulator-5580 ./gradlew connectedDebugAndroidTest
ANDROID_SERIAL=emulator-5580 ./gradlew connectedDebugAndroidTest -Pandroid.injected.device.serial=emulator-5580
```
设备测试需要已启动的模拟器。测试使用独立存储目录和假测试会话,不需要用户账号;Gradle 的 connected 测试任务可能在结束后移除测试安装的 APK。如需继续查看,运行 `./scripts/preview.sh` 重新部署到预览模拟器。