In July 2020, Google Play announced the new safety section, a developer-provided disclosure of apps' data collection, sharing, and security practices. We are preparing documentation about our product behavior for publication and will update this site with more information in the coming weeks.

VideoProgressUpdate

public final class VideoProgressUpdate extends Object

Defines an update to the video's progress. For the cases where progress is requested but not yet available, VideoProgressUpdate#VIDEO_TIME_NOT_READY should be returned.

Field Summary

public static final VideoProgressUpdate VIDEO_TIME_NOT_READY Value to use for cases when progress is not yet defined, such as video initialization.

Public Constructor Summary

VideoProgressUpdate(long currentTimeMs, long durationMs)
Constructs a progress update object.

Public Method Summary

float
getCurrentTime()
This method is deprecated. Use getCurrentTimeMs as a replacement.
long
getCurrentTimeMs()
Returns the current time in milliseconds.
float
getDuration()
This method is deprecated. Use getDurationMs as a replacement.
long
getDurationMs()
Returns the duration in milliseconds.

Inherited Method Summary

Fields

public static final VideoProgressUpdate VIDEO_TIME_NOT_READY

Value to use for cases when progress is not yet defined, such as video initialization.

Public Constructors

public VideoProgressUpdate (long currentTimeMs, long durationMs)

Constructs a progress update object.

Parameters
currentTimeMs progress into video being played in milliseconds.
durationMs total video duration in milliseconds.

Public Methods

public float getCurrentTime ()

This method is deprecated.
Use getCurrentTimeMs as a replacement.

Returns the current playback progress within a video in seconds.

public long getCurrentTimeMs ()

Returns the current time in milliseconds.

public float getDuration ()

This method is deprecated.
Use getDurationMs as a replacement.

Returns the video duration in seconds.

public long getDurationMs ()

Returns the duration in milliseconds.