0
Fork 0
mirror of https://github.com/Silent1566/webhtv.git synced 2026-10-13 18:27:10 +00:00

fix(playback): 退出播放页必定停播,堵住「退回详情页还有声音/通知栏仍显示播放中」

- stopPlayback(): 服务在而本页非归属方时改由服务侧 suspend() 停播并撤掉前台通知。旧实现只走
  mController.stop():控制器未连上时整次调用是空操作,播放器 IDLE(取流中退出)时会被会话
  stop 直接忽略,且这条路径从不撤前台通知。
- startPlayer(): 已决定退出(返回/通知栏停止)的播放页拒绝再次起播,避免迟到的换源/取流链路
  在服务里重新播放并挂上前台通知。
- 新增两条源码契约测试锁定上述语义。

Verification: mobile arm64_v8a debug 编译通过(compileMobileArm64_v8aDebugJavaWithJavac);:app:testMobileArm64_v8aDebugUnitTest --tests PlaybackOwnershipSourceTest 全类通过(含新增 exitingThePlayerPageAlwaysStopsThroughTheService / anExitingPlayerPageNeverStartsPlaybackAgain);ReaderPlaybackRoutingSourceTest#readerResultNeverFallsThroughToVideoPipeline 通过。ReaderPlaybackRoutingSourceTest 的两处 reader.html 契约失败与 PlayerPlaybackRegressionSourceTest 的 CRLF 多行字面量断言均为改动前既有失败(本机工作区为 CRLF 检出),与本次改动无关。

Task-Guard: EXIT-STOP-01
This commit is contained in:
Silent1566 2026-10-11 10:06:11 +08:00
commit 97c7ae68ab
2 changed files with 75 additions and 4 deletions