We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
这边有个需求是:根据视频的倍速调整弹幕的速度。我调整CommentManager的options.global.scale,未出现的弹幕可以满足效果,但是在runline的弹幕不受这个参数的影响,我尝试直接修改runline弹幕的ttl和dur也没有效果,我需要怎么设置才能调整runline的弹幕的速度一致?
The text was updated successfully, but these errors were encountered:
直接修改runline弹幕的ttl和dur
确实这样实现。。。不过CSS弹幕有一些特殊的坑,因为不是靠CommentManager驱动,所以需要多 call 一下 cmt.stop() 来收动删掉旧的CSS,这样下一个tick就能补回来。
cmt.stop()
目前版本上,实现此效果的样本代码,可在demo → code里面测试运行:
// 弹幕速度降低到原来的 1/4 cm.options.global.scale *= 4; cm.runline.forEach(function (cmt) { cmt.ttl *= 4; cmt.dur *= 4; cmt.stop(); // 这个有点hack });
不过这个应该算是 API 实现的 bug,CssComment.ts 里面应该覆盖 ttl 和 dur 的 setter 来自动刷掉旧的 css。
CssComment.ts
TODO 需要fix如下:
修复后直接设 ttl / dur 就应该够了
Sorry, something went wrong.
No branches or pull requests
这边有个需求是:根据视频的倍速调整弹幕的速度。我调整CommentManager的options.global.scale,未出现的弹幕可以满足效果,但是在runline的弹幕不受这个参数的影响,我尝试直接修改runline弹幕的ttl和dur也没有效果,我需要怎么设置才能调整runline的弹幕的速度一致?
The text was updated successfully, but these errors were encountered: