com.brightcove.ssai.tracking.timed

## Class TimedTracker

- java.lang.Object
- - com.brightcove.ssai.tracking.timed.TimedTracker

- All Implemented Interfaces:
    TickerObserver, Tracker, TrackingConfigListener

      public class TimedTracker
      extends java.lang.Object
      implements Tracker, TickerObserver, TrackingConfigListener

  Class in charge of handling the timed tracking events.

- - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static TimedTracker` | `create(Timeline timeline, TrackerDatasource trackerDatasource, java.util.List<com.brightcove.ssai.tracking.timed.TimedTrackingTrigger> timedTrackingTriggers)` Instantiates a TimedTracker.
    `Timeline` | `getTimeline()` Returns the `Timeline`.
    `void` | `onTick(long previous, long current)` A tick represent an poll from the underlying video player.
    `void` | `onTrackingConfigChanged(TrackingConfig trackingConfig)` Triggered when there is a `TrackingConfig` change.
    `void` | `track(java.util.List<TrackingEvent> trackingEvents)` Tracks the given `TrackingEvent`.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### create

          public static TimedTracker create(@NonNull
                                            Timeline timeline,
                                            @NonNull
                                            TrackerDatasource trackerDatasource,
                                            @NonNull
                                            java.util.List<com.brightcove.ssai.tracking.timed.TimedTrackingTrigger> timedTrackingTriggers)

      Instantiates a TimedTracker.
      Parameters:
        `timeline` - an instance of the `Timeline` to track.
        `trackerDatasource` - an instance of `TrackerDatasource`
        `timedTrackingTriggers` - the List of the `TimedTrackingTrigger` to track.
      Returns:
        new instance of a TimedTracker.

    - #### onTick

          public void onTick(long previous,
                             long current)

      Description copied from interface: `TickerObserver`
      A tick represent an poll from the underlying video player.
      Specified by:
        `onTick` in interface `TickerObserver`
      Parameters:
        `previous` - the last playhead position in milliseconds
        `current` - the current playhead position in milliseconds

    - #### getTimeline

          @NonNull
          public Timeline getTimeline()

      Description copied from interface: `Tracker`
      Returns the `Timeline`.
      Specified by:
        `getTimeline` in interface `Tracker`

    - #### track

          public void track(@NonNull
                            java.util.List<TrackingEvent> trackingEvents)

      Description copied from interface: `Tracker`
      Tracks the given `TrackingEvent`.
      Specified by:
        `track` in interface `Tracker`
      Parameters:
        `trackingEvents` - List of events to be tracked.

    - #### onTrackingConfigChanged

          public void onTrackingConfigChanged(@NonNull
                                              TrackingConfig trackingConfig)

      Description copied from interface: `TrackingConfigListener`
      Triggered when there is a `TrackingConfig` change.
      Specified by:
        `onTrackingConfigChanged` in interface `TrackingConfigListener`
      Parameters:
        `trackingConfig` - the tracking config