FileDocCategorySizeDatePackage
MediaTimeProvider.javaAPI DocAndroid 5.1 API3358Thu Mar 12 22:22:30 GMT 2015android.media

MediaTimeProvider

public interface MediaTimeProvider
hide

Fields Summary
public static final long
NO_TIME
Presentation time value if no timed event notification is requested.
Constructors Summary
Methods Summary
public voidcancelNotifications(android.media.MediaTimeProvider$OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any.

public longgetCurrentTimeUs(boolean precise, boolean monotonic)
Get the current presentation time.

param
precise Whether getting a precise time is important. This is more costly.
param
monotonic Whether returned time should be monotonic: that is, greater than or equal to the last returned time. Don't always set this to true. E.g. this has undesired consequences if the media is seeked between calls.
throws
IllegalStateException if the media is not initialized

public voidnotifyAt(long timeUs, android.media.MediaTimeProvider$OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any. It registers the listener to get seek and stop notifications. If timeUs is not negative, it also registers the listener for a timed event notification when the presentation time reaches (becomes greater) than the value specified. This happens immediately if the current media time is larger than or equal to timeUs.

param
timeUs presentation time to get timed event callback at (or {@link #NO_TIME})

public voidscheduleUpdate(android.media.MediaTimeProvider$OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any. It registers the listener to get seek and stop notifications. If the media is stopped, the listener will immediately receive a stop notification. Otherwise, it will receive a timed event notificaton.