public interface MediaTimeProvider
Modifier and Type | Interface and Description |
---|---|
static interface |
MediaTimeProvider.OnMediaTimeListener |
Modifier and Type | Field and Description |
---|---|
static long |
NO_TIME
Presentation time value if no timed event notification is requested.
|
Modifier and Type | Method and Description |
---|---|
void |
cancelNotifications(MediaTimeProvider.OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any.
|
long |
getCurrentTimeUs(boolean precise,
boolean monotonic)
Get the current presentation time.
|
void |
notifyAt(long timeUs,
MediaTimeProvider.OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any.
|
void |
scheduleUpdate(MediaTimeProvider.OnMediaTimeListener listener)
Cancels all previous notification request from this listener if any.
|
static final long NO_TIME
void notifyAt(long timeUs, MediaTimeProvider.OnMediaTimeListener listener)
timeUs
- presentation time to get timed event callback at (or
NO_TIME
)void scheduleUpdate(MediaTimeProvider.OnMediaTimeListener listener)
void cancelNotifications(MediaTimeProvider.OnMediaTimeListener listener)
long getCurrentTimeUs(boolean precise, boolean monotonic) throws IllegalStateException
precise
- Whether getting a precise time is important. This is
more costly.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.IllegalStateException
- if the media is not initialized