Store timed-metadata objects as they are dispatched

Your application is responsible for using the appropriate TimedMetadata objects at the appropriate times.

During content parsing, which happens prior to playback, the PSDK identifies subscribed tags and notifies your application about them. The time associated with each TimedMetadata is the local time on the playback timeline.

Your application must:
  1. Keep track of the current playback time.
  2. Match the current playback time against the already-dispatched TimedMetadata objects.
  3. Use the TimedMetadata where the start time equals the current local playback time. The following example shows how to save TimedMetadata objects in an ArrayList.
    private List<TimedMetadata> _timedMetadataList = new ArrayList<TimedMetadata>();
    ...
    public void onTimedMetadata(TimedMetadata timedMetadata) {
        ...
        if (timedMetadata.getName().equalsIgnoreCase("#EXT-X-CUE"))  {
            _timedMetadataList.add(timedMetadata);
        }
        ...
    }