Your application must use the appropriate TimedMetadata objects at the appropriate times.
During content parsing, which happens before playback, TVSDK identifies subscribed tags and notifies your application about these tags.
The time that is associated with each TimedMetadata
is the local time on the playback timeline.
To store timed metadata objects as they are dispatched:
Keep track of the current playback time.
Match the current playback time to the dispatched TimedMetadata
objects.
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);
}
...
}