S2BPostedDanmaku
public class S2BPostedDanmaku: S2BPostableDanmaku
Danmaku fetched from server
-
CID of the video this danmaku is posted to.
Declaration
Swift
public let cid: Int -
Unique identifier of the danmaku.
Declaration
Swift
public let id: Int -
Encrypted mid indicating the sender of danmaku, nil if was initialized locally.
Declaration
Swift
public let sender: Int? -
If is constructed locally or generated from bilibili server result.
Declaration
Swift
public var wasInitializedLocally: Bool -
Undocumented
Declaration
Swift
public init(_ danmaku: String, cid: Int, playTime: TimeInterval, config: Config, date: Date, id: Int, sender: Int? = nil) -
Undocumented
Declaration
Swift
public convenience init(_ danmaku: String, cid: Int, playTime: TimeInterval, rgb color: Int, fontSize: Config.FontSize!, mode: Config.Mode!, pool: Config.Pool!, date: Date, id: Int, sender: Int? = nil) -
Initialize a new posted danmaku with xml attribute, as in form returned by bilibili server, like the following:
1. MVC see other MVCs as Views. Declaration
Swift
public convenience init!(xmlAttribute p: String, cid: Int, content: String)Parameters
pxml attribute named p.
cidcid in which the danmaku was posted to.
contentcontent of the danmaku.
-
To process all danmaku associated.
Declaration
Swift
public typealias AllDanmakuHandler = (_ allDanmaku: [S2BPostedDanmaku]) -> VoidParameters
allDanmakuall the danmaku for a video.
-
Fetch all danmaku in the given cid.
Declaration
Swift
public static func allDanmaku(ofCID cid: Int, _ handler: @escaping AllDanmakuHandler)Parameters
cidcid which to query danmaku from.
handlerto process all danmaku associated.
-
Check if two posted danmaku are theoretically identical.
Declaration
Swift
public static func ==(lhs: S2BPostedDanmaku, rhs: S2BPostedDanmaku) -> BoolParameters
lhsA posted danmaku
rhsAnother posted danmaku.
Return Value
true if they have the same id and cid, false otherwise.
View on GitHub
Install in Dash
S2BPostedDanmaku Class Reference