Notifications for ads

The event MediaPlayer.PlaybackEventListener.onTimedMetadata notifies your application at the first occurrence in the manifest of each tag that matches a subscribed tag name.

Your application is automatically subscribed to all tags transmitted through setSubscribedTags and through setAdTags.
/**
 * Interface definition of a set of callback to be invoked during playback.
 */
 interface PlaybackEventListener extends EventListener { 
	/**
	 * Called when a new timed metadata is discovered in the manifest.
	 * @param timedMetadata the object encapsulating the metadata information,
	 * such as the relative time, type, tag name and id etc.
	 */
	void onTimedMetadata(TimedMetadata timedMetadata);
	...
}