2021-04-21 11:00:57 +01:00

1008 lines
64 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head><!-- start favicons snippet, use https://realfavicongenerator.net/ --><link rel="apple-touch-icon" sizes="180x180" href="/assets/apple-touch-icon.png"><link rel="icon" type="image/png" sizes="32x32" href="/assets/favicon-32x32.png"><link rel="icon" type="image/png" sizes="16x16" href="/assets/favicon-16x16.png"><link rel="manifest" href="/assets/site.webmanifest"><link rel="mask-icon" href="/assets/safari-pinned-tab.svg" color="#fc4d50"><link rel="shortcut icon" href="/assets/favicon.ico"><meta name="msapplication-TileColor" content="#ffc40d"><meta name="msapplication-config" content="/assets/browserconfig.xml"><meta name="theme-color" content="#ffffff"><!-- end favicons snippet -->
<title>Timeline (ExoPlayer library)</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../../script.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../../jquery/jquery-1.10.2.js"></script>
<script type="text/javascript" src="../../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Timeline (ExoPlayer library)";
}
}
catch(err) {
}
//-->
var methods = {"i0":10,"i1":10,"i2":6,"i3":10,"i4":10,"i5":10,"i6":10,"i7":6,"i8":10,"i9":6,"i10":10,"i11":10,"i12":10,"i13":6,"i14":10,"i15":42,"i16":6,"i17":6,"i18":10,"i19":10,"i20":10};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/google/android/exoplayer2/SimpleExoPlayer.Builder.html" title="class in com.google.android.exoplayer2"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/google/android/exoplayer2/Timeline.html" target="_top">Frames</a></li>
<li><a href="Timeline.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding">&nbsp;</div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="../../../../com/google/android/exoplayer2/package-summary.html">com.google.android.exoplayer2</a></div>
<h2 title="Class Timeline" class="title">Class Timeline</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>com.google.android.exoplayer2.Timeline</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><code><a href="../../../../com/google/android/exoplayer2/AbstractConcatenatedTimeline.html" title="class in com.google.android.exoplayer2">AbstractConcatenatedTimeline</a></code>, <code><a href="../../../../com/google/android/exoplayer2/testutil/FakeTimeline.html" title="class in com.google.android.exoplayer2.testutil">FakeTimeline</a></code>, <code><a href="../../../../com/google/android/exoplayer2/source/ForwardingTimeline.html" title="class in com.google.android.exoplayer2.source">ForwardingTimeline</a></code>, <code><a href="../../../../com/google/android/exoplayer2/source/MaskingMediaSource.PlaceholderTimeline.html" title="class in com.google.android.exoplayer2.source">MaskingMediaSource.PlaceholderTimeline</a></code>, <code><a href="../../../../com/google/android/exoplayer2/source/SinglePeriodTimeline.html" title="class in com.google.android.exoplayer2.source">SinglePeriodTimeline</a></code></dd>
</dl>
<hr>
<pre>public abstract class <span class="typeNameLabel">Timeline</span>
extends <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></pre>
<div class="block">A flexible representation of the structure of media. A timeline is able to represent the
structure of a wide variety of media, from simple cases like a single media file through to
complex compositions of media such as playlists and streams with inserted ads. Instances are
immutable. For cases where media is changing dynamically (e.g. live streams), a timeline provides
a snapshot of the current state.
<p>A timeline consists of <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Windows</code></a> and <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Periods</code></a>.
<ul>
<li>A <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> usually corresponds to one playlist item. It may span one or more periods
and it defines the region within those periods that's currently available for playback. The
window also provides additional information such as whether seeking is supported within the
window and the default position, which is the position from which playback will start when
the player starts playing the window.
<li>A <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> defines a single logical piece of media, for example a media file. It may
also define groups of ads inserted into the media, along with information about whether
those ads have been loaded and played.
</ul>
<p>The following examples illustrate timelines for various use cases.
<h3 id="single-file">Single media file or on-demand stream</h3>
<p style="align:center"><img src="doc-files/timeline-single-file.svg" alt="Example timeline for a
single file">
<p>A timeline for a single media file or on-demand stream consists of a single period and window.
The window spans the whole period, indicating that all parts of the media are available for
playback. The window's default position is typically at the start of the period (indicated by the
black dot in the figure above).
<h3>Playlist of media files or on-demand streams</h3>
<p style="align:center"><img src="doc-files/timeline-playlist.svg" alt="Example timeline for a
playlist of files">
<p>A timeline for a playlist of media files or on-demand streams consists of multiple periods,
each with its own window. Each window spans the whole of the corresponding period, and typically
has a default position at the start of the period. The properties of the periods and windows
(e.g. their durations and whether the window is seekable) will often only become known when the
player starts buffering the corresponding file or stream.
<h3 id="live-limited">Live stream with limited availability</h3>
<p style="align:center"><img src="doc-files/timeline-live-limited.svg" alt="Example timeline for
a live stream with limited availability">
<p>A timeline for a live stream consists of a period whose duration is unknown, since it's
continually extending as more content is broadcast. If content only remains available for a
limited period of time then the window may start at a non-zero position, defining the region of
content that can still be played. The window will return true from <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html#isLive--"><code>Timeline.Window.isLive()</code></a> to
indicate it's a live stream and <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html#isDynamic"><code>Timeline.Window.isDynamic</code></a> will be set to true as long as we expect
changes to the live window. Its default position is typically near to the live edge (indicated by
the black dot in the figure above).
<h3>Live stream with indefinite availability</h3>
<p style="align:center"><img src="doc-files/timeline-live-indefinite.svg" alt="Example timeline
for a live stream with indefinite availability">
<p>A timeline for a live stream with indefinite availability is similar to the <a href="#live-limited">Live stream with limited availability</a> case, except that the window
starts at the beginning of the period to indicate that all of the previously broadcast content
can still be played.
<h3 id="live-multi-period">Live stream with multiple periods</h3>
<p style="align:center"><img src="doc-files/timeline-live-multi-period.svg" alt="Example timeline
for a live stream with multiple periods">
<p>This case arises when a live stream is explicitly divided into separate periods, for example
at content boundaries. This case is similar to the <a href="#live-limited">Live stream with
limited availability</a> case, except that the window may span more than one period. Multiple
periods are also possible in the indefinite availability case.
<h3>On-demand stream followed by live stream</h3>
<p style="align:center"><img src="doc-files/timeline-advanced.svg" alt="Example timeline for an
on-demand stream followed by a live stream">
<p>This case is the concatenation of the <a href="#single-file">Single media file or on-demand
stream</a> and <a href="#multi-period">Live stream with multiple periods</a> cases. When playback
of the on-demand stream ends, playback of the live stream will start from its default position
near the live edge.
<h3 id="single-file-midrolls">On-demand stream with mid-roll ads</h3>
<p style="align:center"><img src="doc-files/timeline-single-file-midrolls.svg" alt="Example
timeline for an on-demand stream with mid-roll ad groups">
<p>This case includes mid-roll ad groups, which are defined as part of the timeline's single
period. The period can be queried for information about the ad groups and the ads they contain.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested.class.summary">
<!-- -->
</a>
<h3>Nested Class Summary</h3>
<table class="memberSummary" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Class</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></span></code></th>
<td class="colLast">
<div class="block">Holds information about a period in a <a href="../../../../com/google/android/exoplayer2/Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a>.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static class&nbsp;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></span></code></th>
<td class="colLast">
<div class="block">Holds information about a window in a <a href="../../../../com/google/android/exoplayer2/Timeline.html" title="class in com.google.android.exoplayer2"><code>Timeline</code></a>.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.summary">
<!-- -->
</a>
<h3>Field Summary</h3>
<table class="memberSummary" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Field</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static <a href="../../../../com/google/android/exoplayer2/Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#EMPTY">EMPTY</a></span></code></th>
<td class="colLast">
<div class="block">An empty timeline.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="memberSummary" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Constructor</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr class="altColor">
<th class="colConstructorName" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#Timeline--">Timeline</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary" summary="Method Summary table, listing methods, and an explanation">
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd">&nbsp;</span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd">&nbsp;</span></span><span id="t6" class="tableTab"><span><a href="javascript:show(32);">Deprecated Methods</a></span><span class="tabEnd">&nbsp;</span></span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tr id="i0" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#equals-java.lang.Object-">equals</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;obj)</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getFirstWindowIndex-boolean-">getFirstWindowIndex</a></span>&#8203;(boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the first window in the playback order depending on whether shuffling is
enabled.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getIndexOfPeriod-java.lang.Object-">getIndexOfPeriod</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;uid)</code></th>
<td class="colLast">
<div class="block">Returns the index of the period identified by its unique <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a>, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period is not in the timeline.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getLastWindowIndex-boolean-">getLastWindowIndex</a></span>&#8203;(boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the last window in the playback order depending on whether shuffling is
enabled.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getNextPeriodIndex-int-com.google.android.exoplayer2.Timeline.Period-com.google.android.exoplayer2.Timeline.Window-int-boolean-">getNextPeriodIndex</a></span>&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the period after the period at index <code>periodIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getNextWindowIndex-int-int-boolean-">getNextWindowIndex</a></span>&#8203;(int&nbsp;windowIndex,
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the window after the window at index <code>windowIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code><a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriod-int-com.google.android.exoplayer2.Timeline.Period-">getPeriod</a></span>&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>abstract <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriod-int-com.google.android.exoplayer2.Timeline.Period-boolean-">getPeriod</a></span>&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
boolean&nbsp;setIds)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code><a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodByUid-java.lang.Object-com.google.android.exoplayer2.Timeline.Period-">getPeriodByUid</a></span>&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;periodUid,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period with the specified unique identifier.</div>
</td>
</tr>
<tr id="i9" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodCount--">getPeriodCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of periods in the timeline.</div>
</td>
</tr>
<tr id="i10" class="altColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Long</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-">getPeriodPosition</a></span>&#8203;(<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
int&nbsp;windowIndex,
long&nbsp;windowPositionUs)</code></th>
<td class="colLast">
<div class="block">Calls <a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-long-"><code>getPeriodPosition(Window, Period, int, long, long)</code></a> with a zero default position
projection.</div>
</td>
</tr>
<tr id="i11" class="rowColor">
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Long</a>&gt;</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-long-">getPeriodPosition</a></span>&#8203;(<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
int&nbsp;windowIndex,
long&nbsp;windowPositionUs,
long&nbsp;defaultPositionProjectionUs)</code></th>
<td class="colLast">
<div class="block">Converts (windowIndex, windowPositionUs) to the corresponding (periodUid, periodPositionUs).</div>
</td>
</tr>
<tr id="i12" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getPreviousWindowIndex-int-int-boolean-">getPreviousWindowIndex</a></span>&#8203;(int&nbsp;windowIndex,
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns the index of the window before the window at index <code>windowIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
<tr id="i13" class="rowColor">
<td class="colFirst"><code>abstract <a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getUidOfPeriod-int-">getUidOfPeriod</a></span>&#8203;(int&nbsp;periodIndex)</code></th>
<td class="colLast">
<div class="block">Returns the unique id of the period identified by its index in the timeline.</div>
</td>
</tr>
<tr id="i14" class="altColor">
<td class="colFirst"><code><a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindow-int-com.google.android.exoplayer2.Timeline.Window-">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
</td>
</tr>
<tr id="i15" class="rowColor">
<td class="colFirst"><code><a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindow-int-com.google.android.exoplayer2.Timeline.Window-boolean-">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
boolean&nbsp;setTag)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindow-int-com.google.android.exoplayer2.Timeline.Window-"><code>getWindow(int, Window)</code></a> instead.</div>
</div>
</td>
</tr>
<tr id="i16" class="altColor">
<td class="colFirst"><code>abstract <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindow-int-com.google.android.exoplayer2.Timeline.Window-long-">getWindow</a></span>&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
long&nbsp;defaultPositionProjectionUs)</code></th>
<td class="colLast">
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
</td>
</tr>
<tr id="i17" class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindowCount--">getWindowCount</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the number of windows in the timeline.</div>
</td>
</tr>
<tr id="i18" class="altColor">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#hashCode--">hashCode</a></span>()</code></th>
<td class="colLast">&nbsp;</td>
</tr>
<tr id="i19" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#isEmpty--">isEmpty</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether the timeline is empty.</div>
</td>
</tr>
<tr id="i20" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer2/Timeline.html#isLastPeriod-int-com.google.android.exoplayer2.Timeline.Period-com.google.android.exoplayer2.Timeline.Window-int-boolean-">isLastPeriod</a></span>&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</code></th>
<td class="colLast">
<div class="block">Returns whether the given period is the last period of the timeline depending on the <code>
repeatMode</code> and whether shuffling is enabled.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></h3>
<code><a href="https://developer.android.com/reference/java/lang/Object.html#clone--" title="class or interface in java.lang" class="externalLink">clone</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang" class="externalLink">finalize</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang" class="externalLink">getClass</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang" class="externalLink">notify</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang" class="externalLink">notifyAll</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang" class="externalLink">toString</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang" class="externalLink">wait</a>, <a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang" class="externalLink" target="_top">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field.detail">
<!-- -->
</a>
<h3>Field Detail</h3>
<a name="EMPTY">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>EMPTY</h4>
<pre>public static final&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.html" title="class in com.google.android.exoplayer2">Timeline</a> EMPTY</pre>
<div class="block">An empty timeline.</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor.detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="Timeline--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Timeline</h4>
<pre>public&nbsp;Timeline()</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="isEmpty--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isEmpty</h4>
<pre>public final&nbsp;boolean&nbsp;isEmpty()</pre>
<div class="block">Returns whether the timeline is empty.</div>
</li>
</ul>
<a name="getWindowCount--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindowCount</h4>
<pre>public abstract&nbsp;int&nbsp;getWindowCount()</pre>
<div class="block">Returns the number of windows in the timeline.</div>
</li>
</ul>
<a name="getNextWindowIndex-int-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextWindowIndex</h4>
<pre>public&nbsp;int&nbsp;getNextWindowIndex&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the window after the window at index <code>windowIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - Index of a window in the timeline.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the next window, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the last window.</dd>
</dl>
</li>
</ul>
<a name="getPreviousWindowIndex-int-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPreviousWindowIndex</h4>
<pre>public&nbsp;int&nbsp;getPreviousWindowIndex&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the window before the window at index <code>windowIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - Index of a window in the timeline.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the previous window, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the first window.</dd>
</dl>
</li>
</ul>
<a name="getLastWindowIndex-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getLastWindowIndex</h4>
<pre>public&nbsp;int&nbsp;getLastWindowIndex&#8203;(boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the last window in the playback order depending on whether shuffling is
enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the last window in the playback order, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the
timeline is empty.</dd>
</dl>
</li>
</ul>
<a name="getFirstWindowIndex-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getFirstWindowIndex</h4>
<pre>public&nbsp;int&nbsp;getFirstWindowIndex&#8203;(boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the first window in the playback order depending on whether shuffling is
enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the first window in the playback order, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the
timeline is empty.</dd>
</dl>
</li>
</ul>
<a name="getWindow-int-com.google.android.exoplayer2.Timeline.Window-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre>public final&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window)</pre>
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - The index of the window.</dd>
<dd><code>window</code> - The <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a name="getWindow-int-com.google.android.exoplayer2.Timeline.Window-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre><a href="https://developer.android.com/reference/java/lang/Deprecated.html" title="class or interface in java.lang" class="externalLink" target="_top">@Deprecated</a>
public final&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
boolean&nbsp;setTag)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">Use <a href="../../../../com/google/android/exoplayer2/Timeline.html#getWindow-int-com.google.android.exoplayer2.Timeline.Window-"><code>getWindow(int, Window)</code></a> instead. Tags will always be set.</div>
</div>
</li>
</ul>
<a name="getWindow-int-com.google.android.exoplayer2.Timeline.Window-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getWindow</h4>
<pre>public abstract&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;getWindow&#8203;(int&nbsp;windowIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
long&nbsp;defaultPositionProjectionUs)</pre>
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> with data for the window at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>windowIndex</code> - The index of the window.</dd>
<dd><code>window</code> - The <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to populate. Must not be null.</dd>
<dd><code>defaultPositionProjectionUs</code> - A duration into the future that the populated window's
default start position should be projected.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a name="getPeriodCount--">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodCount</h4>
<pre>public abstract&nbsp;int&nbsp;getPeriodCount()</pre>
<div class="block">Returns the number of periods in the timeline.</div>
</li>
</ul>
<a name="getNextPeriodIndex-int-com.google.android.exoplayer2.Timeline.Period-com.google.android.exoplayer2.Timeline.Window-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNextPeriodIndex</h4>
<pre>public final&nbsp;int&nbsp;getNextPeriodIndex&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns the index of the period after the period at index <code>periodIndex</code> depending on the
<code>repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - Index of a period in the timeline.</dd>
<dd><code>period</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to be used internally. Must not be null.</dd>
<dd><code>window</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to be used internally. Must not be null.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the next period, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if this is the last period.</dd>
</dl>
</li>
</ul>
<a name="isLastPeriod-int-com.google.android.exoplayer2.Timeline.Period-com.google.android.exoplayer2.Timeline.Window-int-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isLastPeriod</h4>
<pre>public final&nbsp;boolean&nbsp;isLastPeriod&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Player.RepeatMode.html" title="annotation in com.google.android.exoplayer2">@RepeatMode</a>
int&nbsp;repeatMode,
boolean&nbsp;shuffleModeEnabled)</pre>
<div class="block">Returns whether the given period is the last period of the timeline depending on the <code>
repeatMode</code> and whether shuffling is enabled.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - A period index.</dd>
<dd><code>period</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to be used internally. Must not be null.</dd>
<dd><code>window</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> to be used internally. Must not be null.</dd>
<dd><code>repeatMode</code> - A repeat mode.</dd>
<dd><code>shuffleModeEnabled</code> - Whether shuffling is enabled.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the period of the given index is the last period of the timeline.</dd>
</dl>
</li>
</ul>
<a name="getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodPosition</h4>
<pre>public final&nbsp;<a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&gt;&nbsp;getPeriodPosition&#8203;(<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2" target="_top">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
int&nbsp;windowIndex,
long&nbsp;windowPositionUs)</pre>
<div class="block">Calls <a href="../../../../com/google/android/exoplayer2/Timeline.html#getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-long-"><code>getPeriodPosition(Window, Period, int, long, long)</code></a> with a zero default position
projection.</div>
</li>
</ul>
<a name="getPeriodPosition-com.google.android.exoplayer2.Timeline.Window-com.google.android.exoplayer2.Timeline.Period-int-long-long-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodPosition</h4>
<pre>@Nullable
public final&nbsp;<a href="https://developer.android.com/reference/android/util/Pair.html" title="class or interface in android.util" class="externalLink">Pair</a>&lt;<a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink">Object</a>,<a href="https://developer.android.com/reference/java/lang/Long.html?is-external=true" title="class or interface in java.lang" class="externalLink">Long</a>&gt;&nbsp;getPeriodPosition&#8203;(<a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2" target="_top">Timeline.Window</a>&nbsp;window,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
int&nbsp;windowIndex,
long&nbsp;windowPositionUs,
long&nbsp;defaultPositionProjectionUs)</pre>
<div class="block">Converts (windowIndex, windowPositionUs) to the corresponding (periodUid, periodPositionUs).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>window</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Window.html" title="class in com.google.android.exoplayer2"><code>Timeline.Window</code></a> that may be overwritten.</dd>
<dd><code>period</code> - A <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> that may be overwritten.</dd>
<dd><code>windowIndex</code> - The window index.</dd>
<dd><code>windowPositionUs</code> - The window time, or <a href="../../../../com/google/android/exoplayer2/C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a> to use the window's default
start position.</dd>
<dd><code>defaultPositionProjectionUs</code> - If <code>windowPositionUs</code> is <a href="../../../../com/google/android/exoplayer2/C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a>, the
duration into the future by which the window's position should be projected.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The corresponding (periodUid, periodPositionUs), or null if <code>#windowPositionUs</code>
is <a href="../../../../com/google/android/exoplayer2/C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a>, <code>defaultPositionProjectionUs</code> is non-zero, and the window's
position could not be projected by <code>defaultPositionProjectionUs</code>.</dd>
</dl>
</li>
</ul>
<a name="getPeriodByUid-java.lang.Object-com.google.android.exoplayer2.Timeline.Period-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriodByUid</h4>
<pre>public&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriodByUid&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;periodUid,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</pre>
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period with the specified unique identifier.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodUid</code> - The unique identifier of the period.</dd>
<dd><code>period</code> - The <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a name="getPeriod-int-com.google.android.exoplayer2.Timeline.Period-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriod</h4>
<pre>public final&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriod&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period)</pre>
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index. <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#id"><code>Timeline.Period.id</code></a>
and <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a> will be set to null.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dd><code>period</code> - The <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a name="getPeriod-int-com.google.android.exoplayer2.Timeline.Period-boolean-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPeriod</h4>
<pre>public abstract&nbsp;<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;getPeriod&#8203;(int&nbsp;periodIndex,
<a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2">Timeline.Period</a>&nbsp;period,
boolean&nbsp;setIds)</pre>
<div class="block">Populates a <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> with data for the period at the specified index.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dd><code>period</code> - The <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a> to populate. Must not be null.</dd>
<dd><code>setIds</code> - Whether <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#id"><code>Timeline.Period.id</code></a> and <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a> 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.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The populated <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>Timeline.Period</code></a>, for convenience.</dd>
</dl>
</li>
</ul>
<a name="getIndexOfPeriod-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndexOfPeriod</h4>
<pre>public abstract&nbsp;int&nbsp;getIndexOfPeriod&#8203;(<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;uid)</pre>
<div class="block">Returns the index of the period identified by its unique <a href="../../../../com/google/android/exoplayer2/Timeline.Period.html#uid"><code>Timeline.Period.uid</code></a>, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period is not in the timeline.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>uid</code> - A unique identifier for a period.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The index of the period, or <a href="../../../../com/google/android/exoplayer2/C.html#INDEX_UNSET"><code>C.INDEX_UNSET</code></a> if the period was not found.</dd>
</dl>
</li>
</ul>
<a name="getUidOfPeriod-int-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getUidOfPeriod</h4>
<pre>public abstract&nbsp;<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;getUidOfPeriod&#8203;(int&nbsp;periodIndex)</pre>
<div class="block">Returns the unique id of the period identified by its index in the timeline.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>periodIndex</code> - The index of the period.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The unique id of the period.</dd>
</dl>
</li>
</ul>
<a name="equals-java.lang.Object-">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>equals</h4>
<pre>public&nbsp;boolean&nbsp;equals&#8203;(@Nullable
<a href="https://developer.android.com/reference/java/lang/Object.html" title="class or interface in java.lang" class="externalLink" target="_top">Object</a>&nbsp;obj)</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://developer.android.com/reference/java/lang/Object.html#equals-java.lang.Object-" title="class or interface in java.lang" class="externalLink">equals</a></code>&nbsp;in class&nbsp;<code><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></dd>
</dl>
</li>
</ul>
<a name="hashCode--">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>hashCode</h4>
<pre>public&nbsp;int&nbsp;hashCode()</pre>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="https://developer.android.com/reference/java/lang/Object.html#hashCode--" title="class or interface in java.lang" class="externalLink">hashCode</a></code>&nbsp;in class&nbsp;<code><a href="https://developer.android.com/reference/java/lang/Object.html?is-external=true" title="class or interface in java.lang" class="externalLink" target="_top">Object</a></code></dd>
</dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a name="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../../index-all.html">Index</a></li>
<li><a href="../../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/google/android/exoplayer2/SimpleExoPlayer.Builder.html" title="class in com.google.android.exoplayer2"><span class="typeNameLink">Prev&nbsp;Class</span></a></li>
<li><a href="../../../../com/google/android/exoplayer2/Timeline.Period.html" title="class in com.google.android.exoplayer2"><span class="typeNameLink">Next&nbsp;Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/google/android/exoplayer2/Timeline.html" target="_top">Frames</a></li>
<li><a href="Timeline.html" target="_top">No&nbsp;Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All&nbsp;Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li><a href="#nested.class.summary">Nested</a>&nbsp;|&nbsp;</li>
<li><a href="#field.summary">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li><a href="#field.detail">Field</a>&nbsp;|&nbsp;</li>
<li><a href="#constructor.detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a name="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</body>
</html>