CommentCoreLibrary

CCL API (程序接口)

Note, the API spec is not completely and correctly implemented yet. 注意,目前尚未 完全实现这些接口。

CommentManager (弹幕管理器)

The CommentManager is initalized by passing in a single parameter that assigns the HTML DOM object to write comments on. This object should have a class type of container and be a descendant of another wrapper under the class abp. This DOM object is internally referenced as the comment’s “stage”.

If you have not initialized this object and wish to do so, you should use the CommentCore object to initialize the entire set.

弹幕管理器通过提供一个用于渲染的HTML元件来初始化。这个HTML元件应该属于”container”这个css 类 并是 ‘abp’ 类的一个包裹元素的子元素

var cm = new CommentManager ( HtmlDomElement stage )

Example of the DOM substructure (HTML结构体的示例)

<div class = "abp">
	<div class = "container">
		<!--
			This div will become the comment stage
			You should pass a DOM reference to this element NOT its parent
		-->
	</div>
</div>

The CommentManager expose a simple API for manipulating comments. The functions along with their usage will be defined below. CommentManager 会暴露出 一套简单的API来供开发者控制弹幕。