S2BPostedDanmaku

public class S2BPostedDanmaku: S2BPostableDanmaku

Danmaku fetched from server

  • cid

    CID of the video this danmaku is posted to.

    Declaration

    Swift

    public let cid: Int
  • id

    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

    p

    xml attribute named p.

    cid

    cid in which the danmaku was posted to.

    content

    content of the danmaku.

  • To process all danmaku associated.

    Declaration

    Swift

    public typealias AllDanmakuHandler = (_ allDanmaku: [S2BPostedDanmaku]) -> Void

    Parameters

    allDanmaku

    all 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

    cid

    cid which to query danmaku from.

    handler

    to process all danmaku associated.

  • Check if two posted danmaku are theoretically identical.

    Declaration

    Swift

    public static func ==(lhs: S2BPostedDanmaku, rhs: S2BPostedDanmaku) -> Bool

    Parameters

    lhs

    A posted danmaku

    rhs

    Another posted danmaku.

    Return Value

    true if they have the same id and cid, false otherwise.