BitmovinPlayerCollectorApi

@objc(BMABitmovinPlayerCollectorApi)
public protocol BitmovinPlayerCollectorApi : Collector
  • Attach a player instance to this analytics collector.

    With calling this method the collector starts to listen to player events.

    Warning: Needs to be called before loading the source or playlist

    Declaration

    Swift

    func attach(to player: Player)

    Parameters

    player

    The Player instance which will be monitored

  • Applies the given SourceMetadata to the given Source for future usage.

    When the given source is active and played back, the SourceMetadata provided will be sent with each sample

    Use this for playlist setups in order to automatically change SourceMetadata on source transition

    Notes:

    • Existing sourceMetadata will be overriden.
    • Provided CustomData through the SourceMetadata will overwrite the CustomData object set via collector.customData value by value

    Declaration

    Swift

    func apply(sourceMetadata: SourceMetadata, for source: Source)

    Parameters

    sourceMetadata

    The SourceMetadata which will be used

    source

    The Source for which the SourceMetadata will be used

  • Returns the current SourceMetadata for the given Source.

    Notes:

    Declaration

    Swift

    func sourceMetadata(for source: Source) -> SourceMetadata

    Parameters

    source

    The Source for which the SourceMetadata will be returned

  • Applies the given CustomData to the given Source for future usage.

    When the provided Source is currently active, this method will immediatelly change the values by

    • sending out the current sample with old customData and
    • overriding it with new one for upcoming samples

    Declaration

    Swift

    func apply(customData: CustomData, for source: Source)

    Parameters

    customData

    The CustomData which will be used

    source

    The Source for which the CustomData will be used

  • Returns the CustomData for the given Source

    Declaration

    Swift

    func customData(for source: Source) -> CustomData

    Parameters

    source

    The Source for which the CustomData will be returned

  • Declaration

    Swift

    func addSourceMetadata(playerSource: Source, sourceMetadata: SourceMetadata)
  • Declaration

    Swift

    func attachPlayer(player: Player)