Back to Exoplayer

SinglePeriodTimeline (ExoPlayer library)

docs/doc/reference/com/google/android/exoplayer2/source/SinglePeriodTimeline.html

latest21.8 KB
Original Source

Package com.google.android.exoplayer2.source

Class SinglePeriodTimeline


[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public final classSinglePeriodTimelineextends[Timeline](../Timeline.html "class in com.google.android.exoplayer2")

Deprecated. com.google.android.exoplayer2 is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.

A Timeline consisting of a single period and static window.

Nested Class Summary

- 

Nested classes/interfaces inherited from class com.google.android.exoplayer2.Timeline

Timeline.Period, Timeline.RemotableTimeline, Timeline.Window

- 

Nested classes/interfaces inherited from interface com.google.android.exoplayer2.Bundleable

Bundleable.Creator<T extends Bundleable>

Field Summary

- 

Fields inherited from class com.google.android.exoplayer2.Timeline

CREATOR, EMPTY

Constructor Summary

Constructors | Constructor | Description | | --- | --- | | SinglePeriodTimeline​(long durationUs, boolean isSeekable, boolean isDynamic, boolean useLiveConfiguration, Object manifest, MediaItem mediaItem) | Deprecated.

Creates a timeline containing a single period and a window that spans it. | | SinglePeriodTimeline​(long durationUs, boolean isSeekable, boolean isDynamic, boolean isLive, Object manifest, Object tag) | Deprecated. Use SinglePeriodTimeline(long, boolean, boolean, boolean, Object, MediaItem) instead.

| | SinglePeriodTimeline​(long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic, boolean useLiveConfiguration, Object manifest, MediaItem mediaItem) | Deprecated.

Creates a timeline with one period, and a window of known duration starting at a specified position in the period. | | SinglePeriodTimeline​(long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic, boolean isLive, Object manifest, Object tag) | Deprecated. Use SinglePeriodTimeline(long, long, long, long, boolean, boolean, boolean, Object, MediaItem) instead.

| | SinglePeriodTimeline​(long presentationStartTimeMs, long windowStartTimeMs, long elapsedRealtimeEpochOffsetMs, long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic, boolean suppressPositionProjection, Object manifest, MediaItem mediaItem, MediaItem.LiveConfiguration liveConfiguration) | Deprecated.

Creates a timeline with one period, and a window of known duration starting at a specified position in the period. | | SinglePeriodTimeline​(long presentationStartTimeMs, long windowStartTimeMs, long elapsedRealtimeEpochOffsetMs, long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic, boolean isLive, Object manifest, Object tag) | Deprecated. Use SinglePeriodTimeline(long, long, long, long, long, long, long, boolean, boolean, boolean, Object, MediaItem, MediaItem.LiveConfiguration) instead.

| | SinglePeriodTimeline​(long presentationStartTimeMs, long windowStartTimeMs, long elapsedRealtimeEpochOffsetMs, long periodDurationUs, long windowDurationUs, long windowPositionInPeriodUs, long windowDefaultStartPositionUs, boolean isSeekable, boolean isDynamic, Object manifest, MediaItem mediaItem, MediaItem.LiveConfiguration liveConfiguration) | Deprecated. Use SinglePeriodTimeline(long, long, long, long, long, long, long, boolean, boolean, boolean, Object, MediaItem, MediaItem.LiveConfiguration) instead.

|

Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods | Modifier and Type | Method | Description | | --- | --- | --- | | int | getIndexOfPeriod​(Object uid) | Deprecated.

Returns the index of the period identified by its unique Timeline.Period.uid, or C.INDEX_UNSET if the period is not in the timeline. | | Timeline.Period | getPeriod​(int periodIndex, Timeline.Period period, boolean setIds) | Deprecated.

Populates a Timeline.Period with data for the period at the specified index. | | int | getPeriodCount() | Deprecated.

Returns the number of periods in the timeline. | | Object | getUidOfPeriod​(int periodIndex) | Deprecated.

Returns the unique id of the period identified by its index in the timeline. | | Timeline.Window | getWindow​(int windowIndex, Timeline.Window window, long defaultPositionProjectionUs) | Deprecated.

Populates a Timeline.Window with data for the window at the specified index. | | int | getWindowCount() | Deprecated.

Returns the number of windows in the timeline. |

- 

Methods inherited from class com.google.android.exoplayer2.Timeline

equals, getFirstWindowIndex, getLastWindowIndex, getNextPeriodIndex, getNextWindowIndex, getPeriod, getPeriodByUid, getPeriodPosition, getPeriodPosition, getPeriodPositionUs, getPeriodPositionUs, getPreviousWindowIndex, getWindow, hashCode, isEmpty, isLastPeriod, toBundle, toBundleWithOneWindowOnly

- 

Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait

Constructor Detail

- 

SinglePeriodTimeline

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public SinglePeriodTimeline​(long durationUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean isLive,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")tag)

Deprecated. Use SinglePeriodTimeline(long, boolean, boolean, boolean, Object, MediaItem) instead.

- 

SinglePeriodTimeline

public SinglePeriodTimeline​(long durationUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean useLiveConfiguration,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Deprecated.

Creates a timeline containing a single period and a window that spans it. Parameters:durationUs - The duration of the period, in microseconds.isSeekable - Whether seeking is supported within the period.isDynamic - Whether the window may change when the timeline is updated.useLiveConfiguration - Whether the window is live and MediaItem.liveConfiguration is used to configure live playback behaviour.manifest - The manifest. May be null.mediaItem - A media item used for Timeline.Window.mediaItem.

- 

SinglePeriodTimeline

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public SinglePeriodTimeline​(long periodDurationUs,
                            long windowDurationUs,
                            long windowPositionInPeriodUs,
                            long windowDefaultStartPositionUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean isLive,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")tag)

Deprecated. Use SinglePeriodTimeline(long, long, long, long, boolean, boolean, boolean, Object, MediaItem) instead.

- 

SinglePeriodTimeline

public SinglePeriodTimeline​(long periodDurationUs,
                            long windowDurationUs,
                            long windowPositionInPeriodUs,
                            long windowDefaultStartPositionUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean useLiveConfiguration,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem)

Deprecated.

Creates a timeline with one period, and a window of known duration starting at a specified position in the period. Parameters:periodDurationUs - The duration of the period in microseconds.windowDurationUs - The duration of the window in microseconds.windowPositionInPeriodUs - The position of the start of the window in the period, in microseconds.windowDefaultStartPositionUs - The default position relative to the start of the window at which to begin playback, in microseconds.isSeekable - Whether seeking is supported within the window.isDynamic - Whether the window may change when the timeline is updated.useLiveConfiguration - Whether the window is live and MediaItem.liveConfiguration is used to configure live playback behaviour.manifest - The manifest. May be null.mediaItem - A media item used for Timeline.Window.mediaItem.

- 

SinglePeriodTimeline

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public SinglePeriodTimeline​(long presentationStartTimeMs,
                            long windowStartTimeMs,
                            long elapsedRealtimeEpochOffsetMs,
                            long periodDurationUs,
                            long windowDurationUs,
                            long windowPositionInPeriodUs,
                            long windowDefaultStartPositionUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean isLive,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")tag)

Deprecated. Use SinglePeriodTimeline(long, long, long, long, long, long, long, boolean, boolean, boolean, Object, MediaItem, MediaItem.LiveConfiguration) instead.

- 

SinglePeriodTimeline

[@Deprecated](https://developer.android.com/reference/java/lang/Deprecated.html "class or interface in java.lang")public SinglePeriodTimeline​(long presentationStartTimeMs,
                            long windowStartTimeMs,
                            long elapsedRealtimeEpochOffsetMs,
                            long periodDurationUs,
                            long windowDurationUs,
                            long windowPositionInPeriodUs,
                            long windowDefaultStartPositionUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem,
                            @Nullable[MediaItem.LiveConfiguration](../MediaItem.LiveConfiguration.html "class in com.google.android.exoplayer2")liveConfiguration)

Deprecated. Use SinglePeriodTimeline(long, long, long, long, long, long, long, boolean, boolean, boolean, Object, MediaItem, MediaItem.LiveConfiguration) instead.

- 

SinglePeriodTimeline

public SinglePeriodTimeline​(long presentationStartTimeMs,
                            long windowStartTimeMs,
                            long elapsedRealtimeEpochOffsetMs,
                            long periodDurationUs,
                            long windowDurationUs,
                            long windowPositionInPeriodUs,
                            long windowDefaultStartPositionUs,
                            boolean isSeekable,
                            boolean isDynamic,
                            boolean suppressPositionProjection,
                            @Nullable[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")manifest,[MediaItem](../MediaItem.html "class in com.google.android.exoplayer2")mediaItem,
                            @Nullable[MediaItem.LiveConfiguration](../MediaItem.LiveConfiguration.html "class in com.google.android.exoplayer2")liveConfiguration)

Deprecated.

Creates a timeline with one period, and a window of known duration starting at a specified position in the period. Parameters:presentationStartTimeMs - The start time of the presentation in milliseconds since the epoch, or C.TIME_UNSET if unknown or not applicable.windowStartTimeMs - The window's start time in milliseconds since the epoch, or C.TIME_UNSET if unknown or not applicable.elapsedRealtimeEpochOffsetMs - The offset between SystemClock.elapsedRealtime() and the time since the Unix epoch according to the clock of the media origin server, or C.TIME_UNSET if unknown or not applicable.periodDurationUs - The duration of the period in microseconds.windowDurationUs - The duration of the window in microseconds.windowPositionInPeriodUs - The position of the start of the window in the period, in microseconds.windowDefaultStartPositionUs - The default position relative to the start of the window at which to begin playback, in microseconds.isSeekable - Whether seeking is supported within the window.isDynamic - Whether the window may change when the timeline is updated.suppressPositionProjection - Whether position projection in a playlist should be suppressed. This only applies for dynamic timelines and is ignored otherwise.manifest - The manifest. May be null.mediaItem - A media item used for Timeline.Window.mediaItem.liveConfiguration - The configuration for live playback behaviour, or null if the window is not live.

Method Detail

- 

getWindowCount

public int getWindowCount()

Deprecated.

Description copied from class: Timeline

Returns the number of windows in the timeline. Specified by:getWindowCount in class Timeline

- 

getWindow

public[Timeline.Window](../Timeline.Window.html "class in com.google.android.exoplayer2")getWindow​(int windowIndex,[Timeline.Window](../Timeline.Window.html "class in com.google.android.exoplayer2")window,
                                 long defaultPositionProjectionUs)

Deprecated.

Description copied from class: Timeline

Populates a Timeline.Window with data for the window at the specified index. Specified by:getWindow in class TimelineParameters:windowIndex - The index of the window.window - The Timeline.Window to populate. Must not be null.defaultPositionProjectionUs - A duration into the future that the populated window's default start position should be projected.Returns:The populated Timeline.Window, for convenience.

- 

getPeriodCount

public int getPeriodCount()

Deprecated.

Description copied from class: Timeline

Returns the number of periods in the timeline. Specified by:getPeriodCount in class Timeline

- 

getPeriod

public[Timeline.Period](../Timeline.Period.html "class in com.google.android.exoplayer2")getPeriod​(int periodIndex,[Timeline.Period](../Timeline.Period.html "class in com.google.android.exoplayer2")period,
                                 boolean setIds)

Deprecated.

Description copied from class: Timeline

Populates a Timeline.Period with data for the period at the specified index. Specified by:getPeriod in class TimelineParameters:periodIndex - The index of the period.period - The Timeline.Period to populate. Must not be null.setIds - Whether Timeline.Period.id and Timeline.Period.uid should be populated. If false, the fields will be set to null. The caller should pass false for efficiency reasons unless the fields are required.Returns:The populated Timeline.Period, for convenience.

- 

getIndexOfPeriod

public int getIndexOfPeriod​([Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")uid)

Deprecated.

Description copied from class: Timeline

Returns the index of the period identified by its unique Timeline.Period.uid, or C.INDEX_UNSET if the period is not in the timeline. Specified by:getIndexOfPeriod in class TimelineParameters:uid - A unique identifier for a period.Returns:The index of the period, or C.INDEX_UNSET if the period was not found.

- 

getUidOfPeriod

public[Object](https://developer.android.com/reference/java/lang/Object.html "class or interface in java.lang")getUidOfPeriod​(int periodIndex)

Deprecated.

Description copied from class: Timeline

Returns the unique id of the period identified by its index in the timeline. Specified by:getUidOfPeriod in class TimelineParameters:periodIndex - The index of the period.Returns:The unique id of the period.