Skip to content

修复倍速记忆无法保持正常倍速的问题#8

Open
ShowMak3r19 wants to merge 1 commit into
Hazard804:mainfrom
ShowMak3r19:fix-playback-speed-normal-reset
Open

修复倍速记忆无法保持正常倍速的问题#8
ShowMak3r19 wants to merge 1 commit into
Hazard804:mainfrom
ShowMak3r19:fix-playback-speed-normal-reset

Conversation

@ShowMak3r19

@ShowMak3r19 ShowMak3r19 commented Jul 5, 2026

Copy link
Copy Markdown

概要

修复 RememberPlaybackSpeed.js 在用户想改回正常倍速时,会被旧的已保存倍速重新覆盖的问题,同时保留原本“下一集/重新播放继承倍速”的功能。

修改内容

  • 1x 作为有效的已保存倍速处理,用户可以真正把记忆倍速改回正常倍速。
  • 移除了原来的“保护期”轮询逻辑,避免播放器变成 1x 后被无条件改回旧倍速。
  • 新增倍速菜单点击识别,支持 1x1.5x正常原速Normal 等常见文本。
  • 当播放器自动把 playbackRate 临时重置为 1x,并且此前保存的是非正常倍速时,脚本会短暂延迟后恢复旧倍速。
  • 如果用户明确从倍速菜单选择 1x,则保存 1x,后续暂停、快进、退出重新播放不会再被旧倍速覆盖。
  • 保持现有 Web 端 / Emby Theater 外层兼容结构和 localStorage 存储方式不变。

验证

  • 执行 node --check RememberPlaybackSpeed.js,语法检查通过。
  • 使用模拟的 video + localStorage 场景验证:
    • 已保存 1.5x 时,初始化会恢复到 1.5x
    • 播放器自动重置到 1x 时,会恢复回 1.5x
    • 用户明确点击 1x 倍速菜单时,会保存正常倍速。

未测试

  • 未在真实 Emby Web 或 Emby Theater 客户端里手动回归。

Emby can temporarily reset video playbackRate to 1x during playback lifecycle changes. The previous protection loop forced the old saved speed back onto the player, which made an explicit return to normal speed difficult to keep. This change saves explicit speed-menu selections, treats 1x as a valid stored value, and restores the previous non-normal speed only when 1x appears as an automatic reset.

Constraint: Must preserve cross-episode playback speed inheritance while allowing users to intentionally store 1x

Rejected: Keep the 1x protection interval | it overrides intentional normal-speed selections

Confidence: high

Scope-risk: narrow

Directive: Do not treat every 1x ratechange as a user choice; Emby emits automatic 1x resets during playback lifecycle events

Tested: node --check RememberPlaybackSpeed.js

Tested: Node fake video/localStorage harness for initial restore, automatic 1x reset recovery, and explicit 1x menu selection

Not-tested: Live Emby Web or Emby Theater manual session
@ShowMak3r19 ShowMak3r19 changed the title Fix normal speed selection in playback speed memory 修复倍速记忆无法保持正常倍速的问题 Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant