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

全屏调低弹幕速度 #8

Closed
jabbany opened this issue Oct 6, 2014 · 8 comments
Closed

全屏调低弹幕速度 #8

jabbany opened this issue Oct 6, 2014 · 8 comments

Comments

@jabbany
Copy link

jabbany commented Oct 6, 2014

全屏的时候可以调低弹幕速度,通过设置 CommentManager 的速度加成值(bilibili_injected.js:272

var inst = ABP.create({
    allowRescale:true,
    /*以下略*/
});

这样要给出确切的宽度高度,弹幕速度会自动按比例适应,但是宽度高度不能用百分比了。

或者如果只需要分成两种速度的话,可以绑定按钮事件。。。

var inst = ABP.create({/**内部略**/});
inst.btnFull.click(function(){
    if(!inst.state.fullscreen){
        if(inst.cm.def){
            inst.cm.def.scrollScale = 1;
        }else{
            inst.cm.options.scrollScale = 1;
        }
    }else{
        if(inst.cm.def){
            inst.cm.def.scrollScale = 2;
        }else{
            inst.cm.options.scrollScale = 2;
        }
    }
});

之类的。。。以后可能 ABPHTML5会支持派发 Event 把。。。大概。。。>___>

@zacyu
Copy link
Collaborator

zacyu commented Oct 6, 2014

嗯,知道了。顺便问一下 CommentManager 有现成的弹幕字体大小同步吗?

@jabbany
Copy link
Author

jabbany commented Oct 6, 2014

字体大小同步挺好玩的,不是通过CommentManager实现,而是通过固定 container (这里的 ABP-Container)的初始长宽,然后把整个弹幕银幕通过CSS给Scale一下。

效率比让每个弹幕字体增大要高很多,虽然那样也可以。

@jabbany
Copy link
Author

jabbany commented Oct 6, 2014

好多功能设计都只留在脑子里没写过code(掩面

当然,这样就不能开速度同步了

@zacyu
Copy link
Collaborator

zacyu commented Oct 6, 2014

@jabbany 你可以先写到文档里,然后在一点一点 implement 或者别人看到了帮你一起来

@jabbany
Copy link
Author

jabbany commented Oct 6, 2014

嗯。。。。文档也还欠缺好多好多。。。

@cottonty
Copy link

cottonty commented Oct 8, 2014

弹幕字体大小全屏同步能设置成可选么?实在是太巨了。。

@Catofes
Copy link

Catofes commented Oct 8, 2014

各种看不懂了2333

@zacyu
Copy link
Collaborator

zacyu commented Oct 8, 2014

@cottonty 下个版本加入设置,以及同步

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

No branches or pull requests

4 participants