Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

「默认播放速度」功能改进 #1320

Merged

Conversation

LonelySteve
Copy link
Contributor

@LonelySteve LonelySteve commented Dec 15, 2020

来自 #1315

  • 修复:通过扩展快捷键修改倍数后,界面元素(倍数菜单)状态与实际情况不一致
  • 变更:useDefaultVideoSpeed 设置项现在指示是否记忆上次所选的倍数
  • 新增:rememberVideoSpeed 设置项可指示是否记忆视频级别的倍数
    • 依赖 useDefaultVideoSpeed,当 useDefaultVideoSpeed 设置为 true 时,此设置项才有效
  • 新增:rememberVideoSpeedList 设置项用于存储细化到视频级别的倍数记忆值
  • 变更: defaultVideoSpeed 将指示缺省情况下的默认速度值
    • 当启用 useDefaultVideoSpeed 并禁用 rememberVideoSpeed 时,可通过原生倍数菜单(或快捷键扩展)设置不相同的倍数来修改此值
    • 当启用 useDefaultVideoSpeed 并启用 rememberVideoSpeed 时,如果当前视频没有相应的记忆值,则使用此值作为默认值
  • 新增:extendVideoSpeed 设置项可指示是否扩展原生倍数(也会影响快捷键扩展的播放速度上限)
    image

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 15, 2020

图标不用 MDI 的吗, 应该有现成的

@LonelySteve

This comment has been minimized.

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 16, 2020

  1. B 站自己设定的播放速度

这个是啥? 默认都是 1x 吧, 用户如果修改的话就是上面的 用户通过播放器的倍数菜单设定当前视频的速度?

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 16, 2020

有这样的视频吗 我猜测 defaultPlaybackRate 其实就是取 sessionStorage 里的值, 用于切换分 P 时保持播放速度

@LonelySteve

This comment has been minimized.

@LonelySteve LonelySteve changed the title 默认播放速度黑名单 「默认播放速度」功能改进 Dec 16, 2020
@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 16, 2020

能记忆的话, 其实不用去按视频去记忆也行?

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 16, 2020

(只是关于解除记忆的一些随想) 看你 #1315 里的需求吧, 如果你反复需要在不同倍速间观看不同视频, 或者说会去反复观看之前的视频, 可能还是 1 比较好, 如果是一段时间内看一连串视频都使用同样的倍速, 其实可以按 2 来. (因为对于新遇到的不合适视频, 无论是 1 还是 2 都要手动切一次)
其他用户关于这一块的反馈主要就是原生那边界面不同步, 1 和 2 都可以解决.

  1. 按照细化到视频去记忆:
  • 遇到倍速不合适时, 点击原生的切换倍速, 脚本记录 aid 和倍速
  • 切换其他视频时恢复使用脚本的倍速设定
  • 没有很好的判断方法去解除记忆
  1. 仅记忆用户最后一次选择的倍速:
  • 遇到倍速不合适时, 点击原生的切换倍速, 脚本记录倍速
  • 切换其他视频时使用上次记录的倍速
  • 不需要解除记忆

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 16, 2020

那还是得想个清理的办法, 不然越攒越多容易出事(

@LonelySteve

This comment has been minimized.

@LonelySteve

This comment has been minimized.

@the1812
Copy link
Owner

the1812 commented Dec 17, 2020

可以留个按视频记忆的开关, 不在界面上显示, 默认关闭
这样其他用户就不会误解为 bug, 然后你在 console 里打开这个开关就能解决你的问题, 而且你也可以直接在 console 里清除记忆

@LonelySteve
Copy link
Contributor Author

hh,隐藏的高级功能 XD,那对于一般用户实现 方案 2 逻辑吗?方案 2 甚至不需要用户设定全局默认倍数了,还可以省掉一个下拉框

@the1812
Copy link
Owner

the1812 commented Dec 17, 2020

对啊
岂不美哉.jpg

视频级别的记忆功能需通过设置 `rememberVideoSpeed` 项开启
@LonelySteve
Copy link
Contributor Author

LonelySteve commented Dec 17, 2020

我在想要不要改一下名称,把 useDefaultVideoSpeed 改个名叫 useRememberVideoSpeed,相关的文件名也改一下。

这会是个破坏性更改,以前使用「默认视频速度」这个功能的用户将会受到影响。

@the1812
Copy link
Owner

the1812 commented Dec 17, 2020

不用改了, 可以留给以后迁移 2.0 版时再换名字

- 新增设置项 `extendVideoSpeed` 用于指示是否扩展倍数,默认为 false
@LonelySteve LonelySteve marked this pull request as ready for review December 18, 2020 08:09
@LonelySteve
Copy link
Contributor Author

基本搞定了,再看看有什么 BUG 没,快捷键那块没有仔细测试(话说那一块的代码写得真乱啊

@the1812
Copy link
Owner

the1812 commented Dec 18, 2020

一开始就随便写的, 结果他们快捷键需求越来越多就变成这样了(

我有空就测一下吧

@the1812
Copy link
Owner

the1812 commented Dec 19, 2020

测了下, 应该就一个小问题: 未开启settings.extendVideoSpeed时, 快捷键扩展无法加速到 3x (这是快捷键扩展的原有功能)
既然和 rememberVideoSpeed 是分离的, 或许可以把extendVideoSpeed默认打开? 这样更贴合原先的功能配置

@LonelySteve
Copy link
Contributor Author

LonelySteve commented Dec 19, 2020

测了下, 应该就一个小问题: 未开启settings.extendVideoSpeed时, 快捷键扩展无法加速到 3x (这是快捷键扩展的原有功能)
既然和 rememberVideoSpeed 是分离的, 或许可以把extendVideoSpeed默认打开? 这样更贴合原先的功能配置

我是考虑到 extendVideoSpeed 的实现会使用到更多的代码,为了规避风险才将它的默认值设成 false 的,如果想和原来的功能保持一致,那就设成 true 吧,但是这其实依赖于「快捷键扩展」功能,我还是推荐以后给这个设置项增加一个开关。

@LonelySteve

This comment has been minimized.

@the1812 the1812 merged commit fc2248a into the1812:preview Dec 21, 2020
the1812 added a commit that referenced this pull request Dec 21, 2020
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.

None yet

2 participants