Skip to content
Jim Chen edited this page Aug 26, 2017 · 3 revisions

Frequently Asked Questions 常见问题

Below are some frequently asked questions or frequently encountered problems.

Display Problems 显示问题

  1. Why are all the comments squeezed in one line? 为什么滚动弹幕都被挤到了一行(大量重叠)?

    Please check that you are correctly invoking setBounds(width, height) of the CommentSpaceAllocator (CSA) instance. This method should be invoked every time a resize of the comment stage (or percieved comment stage) is initiated to rescale the CommentSpaceAllocators (CSAs). It should also be invoked after initially binding the stage. Failure to do so may cause the CSAs to register a width height of 0,0 and thus allocate only 1 line.

    If you are using the CommentManager directly, init() will auto-set the bounds for you on all registered CSAs. You must call init() only after the DOM is ready (the stage object has been placed into the DOM). If you resize the stage, remember to invoke setBounds() on the CommentManager instance.

    请检查你有正确的调用setBounds(宽度,高度)方法。这个方法需要在每次调整弹幕舞台大小(或者感知大小)时调用。它用于更新空间规划模块的可用空间大小。在刚刚初始化时也应该调用该方法。如果没有调用,则有可能会导致空间规划模块以 0 宽度高度进行初始化,进而只能规划最顶端的一行可用空间。

    如果你只是在使用 CommentManager 对象,调用 init() 时会初始化所有已注册的CSA的舞台大小。请确保你调用 init() 时舞台对象已经在DOM内且DOM已经准备就绪。如果你改变了 stage 大小,请记得顺手调用 CommentManager 的 setBounds() 方法更新空间规划器的大小。

  2. Why does invoking send not add anything? 为什么调用send方法无法添加新的弹幕?

    Please check that you have start()-ed the CommentManager instance. The initialization of the CommentManager (constructor and calling init()) does not also start the comment run-line.

    请确保你已经启动(调用 start())了弹幕管理器的计时器。仅仅加载(通过constructor或者 init())弹幕管理器不会自动启动弹幕运行时间轴。

  3. Typography art is often scrambled or mis-aligned? 经常出现字符拼图对齐错误等影响美观的问题?

    Please check that you have the fonts installed and that your computer can access/render the corresponding fonts. Some commonly seen required fonts are SimHei, YouYuan and MS Yahei. Also check that your window size is appropriate. Some old Typography Art archives require a predetermined windowsize to coerce the space allocator to putting comments at specific positions.

    请检查你有安装中文字体,并且你的浏览器可以正确渲染它们。常见的字体有黑体,幼圆和微软雅黑。(注意:Linux/*nix下系统又是无法通过中文名识别字体,这时请使用fontalias,如果有字体没有出现在fontalias里面也欢迎提交更改)还有请检查你的播放器/弹幕银幕大小合适。有些旧版的弹幕存档会默认固定的窗口大小,来诱导空间规划器的特殊规划方式。

Loading Problems 加载问题

  1. Bilibili formatted XML file does not load (timeline empty). 弹幕文件无法载入。

    Please check that the XML input file is properly XML formatted. Depending on version and configuration, the parser may also accept incorrectly formatted XML files, but that may cause either alert boxes to prompt for confirmination or change the input XML which may cause incompatibilities.

    请检查你的XML输入文件合法。在不同的版本和配置下,有时解析器也会接受错误的XML输入文件,不过这可能会导致弹出确认窗口或是导致文档内容产生部分损坏。这些是安全策略决定的。

  2. Acfun comments sometimes incorrect. Acfun模式弹幕加载不正确

    The Acfun parser is not fully featured yet and contains some slight incompatibilities (namely with fixed point animations). This is a bug yet to be resolved. We're happy to accept fixes.

    ACFUN解码器功能尚未完全,有可能有不兼容情况(主要是对于定位移动弹幕)。这是一位尚未解决的BUG,我们欢迎任何有关的Fix。

Sending Problems 发送问题

CCL does not support sending comments by default. You must build your own way of sending comments to the server. This should not be hard to do and we would like to leave this part to individual implementations to outfit according to their needs.

CCL原生并不支持发送弹幕,你必须自己设计一个发送弹幕的通讯协议。这一般来说应该不难,所以我们把实现留给了使用者自己决定。使用者应当结合自身情况设计发送弹幕的协议。一些常见的协议包跨哦Websockets和Ajax激发的HTTP POST。