olly 936fa7cc15 Update Javadoc for 2.14.0
#minor-release

PiperOrigin-RevId: 373351935
2021-05-17 16:37:39 +01:00

469 lines
20 KiB
HTML

<!DOCTYPE HTML>
<!-- 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>LoadControl (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-3.5.1.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="LoadControl (ExoPlayer library)";
}
}
catch(err) {
}
//-->
var data = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6};
var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],4:["t3","Abstract Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../../";
var useModuleDirectories = false;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.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" id="allclasses_navbar_top">
<li><a href="../../../../allclasses.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="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>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="packageLabelInType">Package</span>&nbsp;<a href="package-summary.html">com.google.android.exoplayer2</a></div>
<h2 title="Interface LoadControl" class="title">Interface LoadControl</h2>
</div>
<div class="contentContainer">
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Known Implementing Classes:</dt>
<dd><code><a href="DefaultLoadControl.html" title="class in com.google.android.exoplayer2">DefaultLoadControl</a></code></dd>
</dl>
<hr>
<pre>public interface <span class="typeNameLabel">LoadControl</span></pre>
<div class="block">Controls buffering of media.</div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="memberSummary">
<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></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><a href="upstream/Allocator.html" title="interface in com.google.android.exoplayer2.upstream">Allocator</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAllocator()">getAllocator</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the <a href="upstream/Allocator.html" title="interface in com.google.android.exoplayer2.upstream"><code>Allocator</code></a> that should be used to obtain media buffer allocations.</div>
</td>
</tr>
<tr id="i1" class="rowColor">
<td class="colFirst"><code>long</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getBackBufferDurationUs()">getBackBufferDurationUs</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the duration of media to retain in the buffer prior to the current playback position,
for fast backward seeking.</div>
</td>
</tr>
<tr id="i2" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onPrepared()">onPrepared</a></span>()</code></th>
<td class="colLast">
<div class="block">Called by the player when prepared with a new source.</div>
</td>
</tr>
<tr id="i3" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onReleased()">onReleased</a></span>()</code></th>
<td class="colLast">
<div class="block">Called by the player when released.</div>
</td>
</tr>
<tr id="i4" class="altColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onStopped()">onStopped</a></span>()</code></th>
<td class="colLast">
<div class="block">Called by the player when stopped.</div>
</td>
</tr>
<tr id="i5" class="rowColor">
<td class="colFirst"><code>void</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#onTracksSelected(com.google.android.exoplayer2.Renderer%5B%5D,com.google.android.exoplayer2.source.TrackGroupArray,com.google.android.exoplayer2.trackselection.ExoTrackSelection%5B%5D)">onTracksSelected</a></span>&#8203;(<a href="Renderer.html" title="interface in com.google.android.exoplayer2">Renderer</a>[]&nbsp;renderers,
<a href="source/TrackGroupArray.html" title="class in com.google.android.exoplayer2.source">TrackGroupArray</a>&nbsp;trackGroups,
<a href="trackselection/ExoTrackSelection.html" title="interface in com.google.android.exoplayer2.trackselection">ExoTrackSelection</a>[]&nbsp;trackSelections)</code></th>
<td class="colLast">
<div class="block">Called by the player when a track selection occurs.</div>
</td>
</tr>
<tr id="i6" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#retainBackBufferFromKeyframe()">retainBackBufferFromKeyframe</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns whether media should be retained from the keyframe before the current playback position
minus <a href="#getBackBufferDurationUs()"><code>getBackBufferDurationUs()</code></a>, rather than any sample before or at that position.</div>
</td>
</tr>
<tr id="i7" class="rowColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shouldContinueLoading(long,long,float)">shouldContinueLoading</a></span>&#8203;(long&nbsp;playbackPositionUs,
long&nbsp;bufferedDurationUs,
float&nbsp;playbackSpeed)</code></th>
<td class="colLast">
<div class="block">Called by the player to determine whether it should continue to load the source.</div>
</td>
</tr>
<tr id="i8" class="altColor">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#shouldStartPlayback(long,float,boolean,long)">shouldStartPlayback</a></span>&#8203;(long&nbsp;bufferedDurationUs,
float&nbsp;playbackSpeed,
boolean&nbsp;rebuffering,
long&nbsp;targetLiveOffsetUs)</code></th>
<td class="colLast">
<div class="block">Called repeatedly by the player when it's loading the source, has yet to start playback, and
has the minimum amount of data necessary for playback to be started.</div>
</td>
</tr>
</table>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="onPrepared()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onPrepared</h4>
<pre class="methodSignature">void&nbsp;onPrepared()</pre>
<div class="block">Called by the player when prepared with a new source.</div>
</li>
</ul>
<a id="onTracksSelected(com.google.android.exoplayer2.Renderer[],com.google.android.exoplayer2.source.TrackGroupArray,com.google.android.exoplayer2.trackselection.ExoTrackSelection[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onTracksSelected</h4>
<pre class="methodSignature">void&nbsp;onTracksSelected&#8203;(<a href="Renderer.html" title="interface in com.google.android.exoplayer2">Renderer</a>[]&nbsp;renderers,
<a href="source/TrackGroupArray.html" title="class in com.google.android.exoplayer2.source">TrackGroupArray</a>&nbsp;trackGroups,
<a href="trackselection/ExoTrackSelection.html" title="interface in com.google.android.exoplayer2.trackselection">ExoTrackSelection</a>[]&nbsp;trackSelections)</pre>
<div class="block">Called by the player when a track selection occurs.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>renderers</code> - The renderers.</dd>
<dd><code>trackGroups</code> - The <a href="source/TrackGroup.html" title="class in com.google.android.exoplayer2.source"><code>TrackGroup</code></a>s from which the selection was made.</dd>
<dd><code>trackSelections</code> - The track selections that were made.</dd>
</dl>
</li>
</ul>
<a id="onStopped()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onStopped</h4>
<pre class="methodSignature">void&nbsp;onStopped()</pre>
<div class="block">Called by the player when stopped.</div>
</li>
</ul>
<a id="onReleased()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>onReleased</h4>
<pre class="methodSignature">void&nbsp;onReleased()</pre>
<div class="block">Called by the player when released.</div>
</li>
</ul>
<a id="getAllocator()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAllocator</h4>
<pre class="methodSignature"><a href="upstream/Allocator.html" title="interface in com.google.android.exoplayer2.upstream">Allocator</a>&nbsp;getAllocator()</pre>
<div class="block">Returns the <a href="upstream/Allocator.html" title="interface in com.google.android.exoplayer2.upstream"><code>Allocator</code></a> that should be used to obtain media buffer allocations.</div>
</li>
</ul>
<a id="getBackBufferDurationUs()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getBackBufferDurationUs</h4>
<pre class="methodSignature">long&nbsp;getBackBufferDurationUs()</pre>
<div class="block">Returns the duration of media to retain in the buffer prior to the current playback position,
for fast backward seeking.
<p>Note: If <a href="#retainBackBufferFromKeyframe()"><code>retainBackBufferFromKeyframe()</code></a> is false then seeking in the back-buffer
will only be fast if the back-buffer contains a keyframe prior to the seek position.
<p>Note: Implementations should return a single value. Dynamic changes to the back-buffer are
not currently supported.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The duration of media to retain in the buffer prior to the current playback position,
in microseconds.</dd>
</dl>
</li>
</ul>
<a id="retainBackBufferFromKeyframe()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>retainBackBufferFromKeyframe</h4>
<pre class="methodSignature">boolean&nbsp;retainBackBufferFromKeyframe()</pre>
<div class="block">Returns whether media should be retained from the keyframe before the current playback position
minus <a href="#getBackBufferDurationUs()"><code>getBackBufferDurationUs()</code></a>, rather than any sample before or at that position.
<p>Warning: Returning true will cause the back-buffer size to depend on the spacing of
keyframes in the media being played. Returning true is not recommended unless you control the
media and are comfortable with the back-buffer size exceeding <a href="#getBackBufferDurationUs()"><code>getBackBufferDurationUs()</code></a> by as much as the maximum duration between adjacent keyframes in
the media.
<p>Note: Implementations should return a single value. Dynamic changes to the back-buffer are
not currently supported.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether media should be retained from the keyframe before the current playback position
minus <a href="#getBackBufferDurationUs()"><code>getBackBufferDurationUs()</code></a>, rather than any sample before or at that
position.</dd>
</dl>
</li>
</ul>
<a id="shouldContinueLoading(long,long,float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>shouldContinueLoading</h4>
<pre class="methodSignature">boolean&nbsp;shouldContinueLoading&#8203;(long&nbsp;playbackPositionUs,
long&nbsp;bufferedDurationUs,
float&nbsp;playbackSpeed)</pre>
<div class="block">Called by the player to determine whether it should continue to load the source.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>playbackPositionUs</code> - The current playback position in microseconds, relative to the start
of the <a href="Timeline.Period.html" title="class in com.google.android.exoplayer2"><code>period</code></a> that will continue to be loaded if this method
returns <code>true</code>. If playback of this period has not yet started, the value will be
negative and equal in magnitude to the duration of any media in previous periods still to
be played.</dd>
<dd><code>bufferedDurationUs</code> - The duration of media that's currently buffered.</dd>
<dd><code>playbackSpeed</code> - The current factor by which playback is sped up.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether the loading should continue.</dd>
</dl>
</li>
</ul>
<a id="shouldStartPlayback(long,float,boolean,long)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>shouldStartPlayback</h4>
<pre class="methodSignature">boolean&nbsp;shouldStartPlayback&#8203;(long&nbsp;bufferedDurationUs,
float&nbsp;playbackSpeed,
boolean&nbsp;rebuffering,
long&nbsp;targetLiveOffsetUs)</pre>
<div class="block">Called repeatedly by the player when it's loading the source, has yet to start playback, and
has the minimum amount of data necessary for playback to be started. The value returned
determines whether playback is actually started. The load control may opt to return <code>
false</code> until some condition has been met (e.g. a certain amount of media is buffered).</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>bufferedDurationUs</code> - The duration of media that's currently buffered.</dd>
<dd><code>playbackSpeed</code> - The current factor by which playback is sped up.</dd>
<dd><code>rebuffering</code> - Whether the player is rebuffering. A rebuffer is defined to be caused by
buffer depletion rather than a user action. Hence this parameter is false during initial
buffering and when buffering as a result of a seek operation.</dd>
<dd><code>targetLiveOffsetUs</code> - The desired playback position offset to the live edge in
microseconds, or <a href="C.html#TIME_UNSET"><code>C.TIME_UNSET</code></a> if the media is not a live stream or no offset is
configured.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>Whether playback should be allowed to start or resume.</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../index.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" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses.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>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li>Constr&nbsp;|&nbsp;</li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<a id="skip.navbar.bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
</nav>
</footer>
</body>
</html>