963 lines
46 KiB
HTML
963 lines
46 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>
|
|
<!-- Generated by javadoc (1.8.0_101) on Wed Dec 14 17:18:31 GMT 2016 -->
|
|
<title>ExoPlayer (ExoPlayer library)</title>
|
|
<meta name="date" content="2016-12-14">
|
|
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
|
|
<script type="text/javascript" src="../../../../script.js"></script>
|
|
</head>
|
|
<body>
|
|
<script type="text/javascript"><!--
|
|
try {
|
|
if (location.href.indexOf('is-external=true') == -1) {
|
|
parent.document.title="ExoPlayer (ExoPlayer library)";
|
|
}
|
|
}
|
|
catch(err) {
|
|
}
|
|
//-->
|
|
var methods = {"i0":6,"i1":6,"i2":6,"i3":6,"i4":6,"i5":6,"i6":6,"i7":6,"i8":6,"i9":6,"i10":6,"i11":6,"i12":6,"i13":6,"i14":6,"i15":6,"i16":6,"i17":6,"i18":6,"i19":6,"i20":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";
|
|
</script>
|
|
<noscript>
|
|
<div>JavaScript is disabled on your browser.</div>
|
|
</noscript>
|
|
<!-- ========= 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/exoplayer/ExoPlaybackException.html" title="class in com.google.android.exoplayer"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../index.html?com/google/android/exoplayer/ExoPlayer.html" target="_top">Frames</a></li>
|
|
<li><a href="ExoPlayer.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_top">
|
|
<li><a href="../../../../allclasses-noframe.html">All Classes</a></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>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.top">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
|
<!-- ======== START OF CLASS DATA ======== -->
|
|
<div class="header">
|
|
<div class="subTitle">com.google.android.exoplayer</div>
|
|
<h2 title="Interface ExoPlayer" class="title">Interface ExoPlayer</h2>
|
|
</div>
|
|
<div class="contentContainer">
|
|
<div class="description">
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<hr>
|
|
<br>
|
|
<pre>public interface <span class="typeNameLabel">ExoPlayer</span></pre>
|
|
<div class="block">An extensible media player exposing traditional high-level media player functionality, such as
|
|
the ability to prepare, play, pause and seek.
|
|
|
|
<p>Topics covered here are:
|
|
<ol>
|
|
<li><a href="#Assumptions">Assumptions and player composition</a>
|
|
<li><a href="#Threading">Threading model</a>
|
|
<li><a href="#State">Player state</a>
|
|
</ol>
|
|
|
|
<a name="Assumptions"></a>
|
|
<h3>Assumptions and player construction</h3>
|
|
|
|
<p>The implementation is designed to make no assumptions about (and hence impose no restrictions
|
|
on) the type of the media being played, how and where it is stored, or how it is rendered.
|
|
Rather than implementing the loading and rendering of media directly, <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a> instead
|
|
delegates this work to one or more <a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a>s, which are injected when the player
|
|
is prepared. Hence <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a> is capable of loading and playing any media for which a
|
|
<a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a> implementation can be provided.
|
|
|
|
<p><a href="../../../../com/google/android/exoplayer/MediaCodecAudioTrackRenderer.html" title="class in com.google.android.exoplayer"><code>MediaCodecAudioTrackRenderer</code></a> and <a href="../../../../com/google/android/exoplayer/MediaCodecVideoTrackRenderer.html" title="class in com.google.android.exoplayer"><code>MediaCodecVideoTrackRenderer</code></a> can be used for
|
|
the common cases of rendering audio and video. These components in turn require an
|
|
<i>upstream</i> <a href="../../../../com/google/android/exoplayer/SampleSource.html" title="interface in com.google.android.exoplayer"><code>SampleSource</code></a> to be injected through their constructors, where upstream
|
|
is defined to denote a component that is closer to the source of the media. This pattern of
|
|
upstream dependency injection is actively encouraged, since it means that the functionality of
|
|
the player is built up through the composition of components that can easily be exchanged for
|
|
alternate implementations. For example a <a href="../../../../com/google/android/exoplayer/SampleSource.html" title="interface in com.google.android.exoplayer"><code>SampleSource</code></a> implementation may require a
|
|
further upstream data loading component to be injected through its constructor, with different
|
|
implementations enabling the loading of data from various sources.
|
|
|
|
<a name="Threading"></a>
|
|
<h3>Threading model</h3>
|
|
|
|
<p>The figure below shows the <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a> threading model.</p>
|
|
<p align="center"><img src="doc-files/exoplayer-threading-model.png"
|
|
alt="MediaPlayer state diagram"
|
|
border="0"></p>
|
|
|
|
<ul>
|
|
<li>It is recommended that instances are created and accessed from a single application thread.
|
|
An application's main thread is ideal. Accessing an instance from multiple threads is
|
|
discouraged, however if an application does wish to do this then it may do so provided that it
|
|
ensures accesses are synchronized.
|
|
</li>
|
|
<li>Registered <a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer.Listener</code></a>s are invoked on the thread that created the <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a>
|
|
instance.</li>
|
|
<li>An internal playback thread is responsible for managing playback and invoking the
|
|
<a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a>s in order to load and play the media.</li>
|
|
<li><a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a> implementations (or any upstream components that they depend on) may
|
|
use additional background threads (e.g. to load data). These are implementation specific.</li>
|
|
</ul>
|
|
|
|
<a name="State"></a>
|
|
<h3>Player state</h3>
|
|
|
|
<p>The components of an <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a>'s state can be divided into two distinct groups. State
|
|
accessed by <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getSelectedTrack-int-"><code>getSelectedTrack(int)</code></a> and <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--"><code>getPlayWhenReady()</code></a> is only ever
|
|
changed by invoking the player's methods, and are never changed as a result of operations that
|
|
have been performed asynchronously by the playback thread. In contrast, the playback state
|
|
accessed by <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--"><code>getPlaybackState()</code></a> is only ever changed as a result of operations
|
|
completing on the playback thread, as illustrated below.</p>
|
|
<p align="center"><img src="doc-files/exoplayer-state.png"
|
|
alt="ExoPlayer state"
|
|
border="0"></p>
|
|
|
|
<p>The possible playback state transitions are shown below. Transitions can be triggered either
|
|
by changes in the state of the <a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a>s being used, or as a result of
|
|
<a href="../../../../com/google/android/exoplayer/ExoPlayer.html#prepare-com.google.android.exoplayer.TrackRenderer...-"><code>prepare(TrackRenderer[])</code></a>, <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#stop--"><code>stop()</code></a> or <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#release--"><code>release()</code></a> being invoked.</p>
|
|
<p align="center"><img src="doc-files/exoplayer-playbackstate.png"
|
|
alt="ExoPlayer playback state transitions"
|
|
border="0"></p></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" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
|
|
<caption><span>Nested Classes</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Interface and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static interface </code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer">ExoPlayer.ExoPlayerComponent</a></span></code>
|
|
<div class="block">A component of an <a href="../../../../com/google/android/exoplayer/ExoPlayer.html" title="interface in com.google.android.exoplayer"><code>ExoPlayer</code></a> that can receive messages on the playback thread.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static class </code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.Factory.html" title="class in com.google.android.exoplayer">ExoPlayer.Factory</a></span></code>
|
|
<div class="block">A factory for instantiating ExoPlayer instances.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static interface </code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer">ExoPlayer.Listener</a></span></code>
|
|
<div class="block">Interface definition for a callback to be notified of changes in player state.</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" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
|
|
<caption><span>Fields</span><span class="tabEnd"> </span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Field and Description</th>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_BUFFERING">STATE_BUFFERING</a></span></code>
|
|
<div class="block">The player is prepared but not able to immediately play from the current position.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_ENDED">STATE_ENDED</a></span></code>
|
|
<div class="block">The player has finished playing the media.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_IDLE">STATE_IDLE</a></span></code>
|
|
<div class="block">The player is neither prepared or being prepared.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_PREPARING">STATE_PREPARING</a></span></code>
|
|
<div class="block">The player is being prepared.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_READY">STATE_READY</a></span></code>
|
|
<div class="block">The player is prepared and able to immediately play from the current position.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#TRACK_DEFAULT">TRACK_DEFAULT</a></span></code>
|
|
<div class="block">A value that can be passed as the second argument to <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setSelectedTrack-int-int-"><code>setSelectedTrack(int, int)</code></a> to
|
|
select the default track.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="altColor">
|
|
<td class="colFirst"><code>static int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#TRACK_DISABLED">TRACK_DISABLED</a></span></code>
|
|
<div class="block">A value that can be passed as the second argument to <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setSelectedTrack-int-int-"><code>setSelectedTrack(int, int)</code></a> to
|
|
disable the renderer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr class="rowColor">
|
|
<td class="colFirst"><code>static long</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#UNKNOWN_TIME">UNKNOWN_TIME</a></span></code>
|
|
<div class="block">Represents an unknown time or duration.</div>
|
|
</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" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
|
|
<caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t3" class="tableTab"><span><a href="javascript:show(4);">Abstract Methods</a></span><span class="tabEnd"> </span></span></caption>
|
|
<tr>
|
|
<th class="colFirst" scope="col">Modifier and Type</th>
|
|
<th class="colLast" scope="col">Method and Description</th>
|
|
</tr>
|
|
<tr id="i0" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#addListener-com.google.android.exoplayer.ExoPlayer.Listener-">addListener</a></span>(<a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer">ExoPlayer.Listener</a> listener)</code>
|
|
<div class="block">Register a listener to receive events from the player.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i1" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#blockingSendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-">blockingSendMessage</a></span>(<a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer">ExoPlayer.ExoPlayerComponent</a> target,
|
|
int messageType,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> message)</code>
|
|
<div class="block">Blocking variant of <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#sendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-"><code>sendMessage(ExoPlayerComponent, int, Object)</code></a> that does not return
|
|
until after the message has been delivered.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i2" class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getBufferedPercentage--">getBufferedPercentage</a></span>()</code>
|
|
<div class="block">Gets an estimate of the percentage into the media up to which data is buffered.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i3" class="rowColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getBufferedPosition--">getBufferedPosition</a></span>()</code>
|
|
<div class="block">Gets an estimate of the absolute position in milliseconds up to which data is buffered.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i4" class="altColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getCurrentPosition--">getCurrentPosition</a></span>()</code>
|
|
<div class="block">Gets the current playback position in milliseconds.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i5" class="rowColor">
|
|
<td class="colFirst"><code>long</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getDuration--">getDuration</a></span>()</code>
|
|
<div class="block">Gets the duration of the track in milliseconds.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i6" class="altColor">
|
|
<td class="colFirst"><code><a href="https://developer.android.com/reference/android/os/Looper.html?is-external=true" title="class or interface in android.os">Looper</a></code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackLooper--">getPlaybackLooper</a></span>()</code>
|
|
<div class="block">Gets the <a href="https://developer.android.com/reference/android/os/Looper.html?is-external=true" title="class or interface in android.os"><code>Looper</code></a> associated with the playback thread.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i7" class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--">getPlaybackState</a></span>()</code>
|
|
<div class="block">Returns the current state of the player.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i8" class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--">getPlayWhenReady</a></span>()</code>
|
|
<div class="block">Whether playback will proceed when <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--"><code>getPlaybackState()</code></a> == <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_READY"><code>STATE_READY</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i9" class="rowColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getSelectedTrack-int-">getSelectedTrack</a></span>(int rendererIndex)</code>
|
|
<div class="block">Returns the index of the currently selected track for the specified renderer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i10" class="altColor">
|
|
<td class="colFirst"><code>int</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getTrackCount-int-">getTrackCount</a></span>(int rendererIndex)</code>
|
|
<div class="block">Returns the number of tracks exposed by the specified renderer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i11" class="rowColor">
|
|
<td class="colFirst"><code><a href="../../../../com/google/android/exoplayer/MediaFormat.html" title="class in com.google.android.exoplayer">MediaFormat</a></code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getTrackFormat-int-int-">getTrackFormat</a></span>(int rendererIndex,
|
|
int trackIndex)</code>
|
|
<div class="block">Returns the format of a track.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i12" class="altColor">
|
|
<td class="colFirst"><code>boolean</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#isPlayWhenReadyCommitted--">isPlayWhenReadyCommitted</a></span>()</code>
|
|
<div class="block">Whether the current value of <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--"><code>getPlayWhenReady()</code></a> has been reflected by the
|
|
internal playback thread.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i13" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#prepare-com.google.android.exoplayer.TrackRenderer...-">prepare</a></span>(<a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer">TrackRenderer</a>... renderers)</code>
|
|
<div class="block">Prepares the player for playback.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i14" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#release--">release</a></span>()</code>
|
|
<div class="block">Releases the player.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i15" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#removeListener-com.google.android.exoplayer.ExoPlayer.Listener-">removeListener</a></span>(<a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer">ExoPlayer.Listener</a> listener)</code>
|
|
<div class="block">Unregister a listener.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i16" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#seekTo-long-">seekTo</a></span>(long positionMs)</code>
|
|
<div class="block">Seeks to a position specified in milliseconds.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i17" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#sendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-">sendMessage</a></span>(<a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer">ExoPlayer.ExoPlayerComponent</a> target,
|
|
int messageType,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> message)</code>
|
|
<div class="block">Sends a message to a specified component.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i18" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setPlayWhenReady-boolean-">setPlayWhenReady</a></span>(boolean playWhenReady)</code>
|
|
<div class="block">Sets whether playback should proceed when <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--"><code>getPlaybackState()</code></a> == <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_READY"><code>STATE_READY</code></a>.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i19" class="rowColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setSelectedTrack-int-int-">setSelectedTrack</a></span>(int rendererIndex,
|
|
int trackIndex)</code>
|
|
<div class="block">Selects a track for the specified renderer.</div>
|
|
</td>
|
|
</tr>
|
|
<tr id="i20" class="altColor">
|
|
<td class="colFirst"><code>void</code></td>
|
|
<td class="colLast"><code><span class="memberNameLink"><a href="../../../../com/google/android/exoplayer/ExoPlayer.html#stop--">stop</a></span>()</code>
|
|
<div class="block">Stops playback.</div>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
</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="STATE_IDLE">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>STATE_IDLE</h4>
|
|
<pre>static final int STATE_IDLE</pre>
|
|
<div class="block">The player is neither prepared or being prepared.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.STATE_IDLE">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="STATE_PREPARING">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>STATE_PREPARING</h4>
|
|
<pre>static final int STATE_PREPARING</pre>
|
|
<div class="block">The player is being prepared.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.STATE_PREPARING">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="STATE_BUFFERING">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>STATE_BUFFERING</h4>
|
|
<pre>static final int STATE_BUFFERING</pre>
|
|
<div class="block">The player is prepared but not able to immediately play from the current position. The cause
|
|
is <a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a> specific, but this state typically occurs when more data needs
|
|
to be buffered for playback to start.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.STATE_BUFFERING">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="STATE_READY">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>STATE_READY</h4>
|
|
<pre>static final int STATE_READY</pre>
|
|
<div class="block">The player is prepared and able to immediately play from the current position. The player will
|
|
be playing if <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--"><code>getPlayWhenReady()</code></a> returns true, and paused otherwise.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.STATE_READY">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="STATE_ENDED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>STATE_ENDED</h4>
|
|
<pre>static final int STATE_ENDED</pre>
|
|
<div class="block">The player has finished playing the media.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.STATE_ENDED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TRACK_DISABLED">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TRACK_DISABLED</h4>
|
|
<pre>static final int TRACK_DISABLED</pre>
|
|
<div class="block">A value that can be passed as the second argument to <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setSelectedTrack-int-int-"><code>setSelectedTrack(int, int)</code></a> to
|
|
disable the renderer.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.TRACK_DISABLED">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="TRACK_DEFAULT">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>TRACK_DEFAULT</h4>
|
|
<pre>static final int TRACK_DEFAULT</pre>
|
|
<div class="block">A value that can be passed as the second argument to <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#setSelectedTrack-int-int-"><code>setSelectedTrack(int, int)</code></a> to
|
|
select the default track.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.TRACK_DEFAULT">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="UNKNOWN_TIME">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>UNKNOWN_TIME</h4>
|
|
<pre>static final long UNKNOWN_TIME</pre>
|
|
<div class="block">Represents an unknown time or duration.</div>
|
|
<dl>
|
|
<dt><span class="seeLabel">See Also:</span></dt>
|
|
<dd><a href="../../../../constant-values.html#com.google.android.exoplayer.ExoPlayer.UNKNOWN_TIME">Constant Field Values</a></dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<!-- ============ METHOD DETAIL ========== -->
|
|
<ul class="blockList">
|
|
<li class="blockList"><a name="method.detail">
|
|
<!-- -->
|
|
</a>
|
|
<h3>Method Detail</h3>
|
|
<a name="getPlaybackLooper--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPlaybackLooper</h4>
|
|
<pre><a href="https://developer.android.com/reference/android/os/Looper.html?is-external=true" title="class or interface in android.os">Looper</a> getPlaybackLooper()</pre>
|
|
<div class="block">Gets the <a href="https://developer.android.com/reference/android/os/Looper.html?is-external=true" title="class or interface in android.os"><code>Looper</code></a> associated with the playback thread.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The <a href="https://developer.android.com/reference/android/os/Looper.html?is-external=true" title="class or interface in android.os"><code>Looper</code></a> associated with the playback thread.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="addListener-com.google.android.exoplayer.ExoPlayer.Listener-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>addListener</h4>
|
|
<pre>void addListener(<a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer">ExoPlayer.Listener</a> listener)</pre>
|
|
<div class="block">Register a listener to receive events from the player. The listener's methods will be invoked
|
|
on the thread that was used to construct the player.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>listener</code> - The listener to register.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="removeListener-com.google.android.exoplayer.ExoPlayer.Listener-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>removeListener</h4>
|
|
<pre>void removeListener(<a href="../../../../com/google/android/exoplayer/ExoPlayer.Listener.html" title="interface in com.google.android.exoplayer">ExoPlayer.Listener</a> listener)</pre>
|
|
<div class="block">Unregister a listener. The listener will no longer receive events from the player.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>listener</code> - The listener to unregister.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getPlaybackState--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPlaybackState</h4>
|
|
<pre>int getPlaybackState()</pre>
|
|
<div class="block">Returns the current state of the player.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>One of the <code>STATE</code> constants defined in this interface.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="prepare-com.google.android.exoplayer.TrackRenderer...-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>prepare</h4>
|
|
<pre>void prepare(<a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer">TrackRenderer</a>... renderers)</pre>
|
|
<div class="block">Prepares the player for playback.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>renderers</code> - The <a href="../../../../com/google/android/exoplayer/TrackRenderer.html" title="class in com.google.android.exoplayer"><code>TrackRenderer</code></a>s to use. The number of renderers must match the
|
|
value that was passed to the <a href="../../../../com/google/android/exoplayer/ExoPlayer.Factory.html#newInstance-int-int-int-"><code>ExoPlayer.Factory.newInstance(int, int, int)</code></a> method.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getTrackCount-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getTrackCount</h4>
|
|
<pre>int getTrackCount(int rendererIndex)</pre>
|
|
<div class="block">Returns the number of tracks exposed by the specified renderer.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>rendererIndex</code> - The index of the renderer.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The number of tracks.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getTrackFormat-int-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getTrackFormat</h4>
|
|
<pre><a href="../../../../com/google/android/exoplayer/MediaFormat.html" title="class in com.google.android.exoplayer">MediaFormat</a> getTrackFormat(int rendererIndex,
|
|
int trackIndex)</pre>
|
|
<div class="block">Returns the format of a track.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>rendererIndex</code> - The index of the renderer.</dd>
|
|
<dd><code>trackIndex</code> - The index of the track.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The format of the track.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setSelectedTrack-int-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setSelectedTrack</h4>
|
|
<pre>void setSelectedTrack(int rendererIndex,
|
|
int trackIndex)</pre>
|
|
<div class="block">Selects a track for the specified renderer.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>rendererIndex</code> - The index of the renderer.</dd>
|
|
<dd><code>trackIndex</code> - The index of the track. A negative value or a value greater than or equal to
|
|
the renderer's track count will disable the renderer.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getSelectedTrack-int-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getSelectedTrack</h4>
|
|
<pre>int getSelectedTrack(int rendererIndex)</pre>
|
|
<div class="block">Returns the index of the currently selected track for the specified renderer.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>rendererIndex</code> - The index of the renderer.</dd>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The selected track. A negative value or a value greater than or equal to the renderer's
|
|
track count indicates that the renderer is disabled.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="setPlayWhenReady-boolean-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>setPlayWhenReady</h4>
|
|
<pre>void setPlayWhenReady(boolean playWhenReady)</pre>
|
|
<div class="block">Sets whether playback should proceed when <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--"><code>getPlaybackState()</code></a> == <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_READY"><code>STATE_READY</code></a>.
|
|
If the player is already in this state, then this method can be used to pause and resume
|
|
playback.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>playWhenReady</code> - Whether playback should proceed when ready.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getPlayWhenReady--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getPlayWhenReady</h4>
|
|
<pre>boolean getPlayWhenReady()</pre>
|
|
<div class="block">Whether playback will proceed when <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlaybackState--"><code>getPlaybackState()</code></a> == <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_READY"><code>STATE_READY</code></a>.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>Whether playback will proceed when ready.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="isPlayWhenReadyCommitted--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>isPlayWhenReadyCommitted</h4>
|
|
<pre>boolean isPlayWhenReadyCommitted()</pre>
|
|
<div class="block">Whether the current value of <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#getPlayWhenReady--"><code>getPlayWhenReady()</code></a> has been reflected by the
|
|
internal playback thread.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>True if the current value has been reflected. False otherwise.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="seekTo-long-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>seekTo</h4>
|
|
<pre>void seekTo(long positionMs)</pre>
|
|
<div class="block">Seeks to a position specified in milliseconds.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>positionMs</code> - The seek position.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="stop--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>stop</h4>
|
|
<pre>void stop()</pre>
|
|
<div class="block">Stops playback. Use <code>setPlayWhenReady(false)</code> rather than this method if the intention
|
|
is to pause playback.
|
|
<p>
|
|
Calling this method will cause the playback state to transition to
|
|
<a href="../../../../com/google/android/exoplayer/ExoPlayer.html#STATE_IDLE"><code>STATE_IDLE</code></a>. The player instance can still be used, and
|
|
<a href="../../../../com/google/android/exoplayer/ExoPlayer.html#release--"><code>release()</code></a> must still be called on the player if it's no longer required.
|
|
<p>
|
|
Calling this method does not reset the playback position. If this player instance will be used
|
|
to play another video from its start, then <code>seekTo(0)</code> should be called after stopping
|
|
the player and before preparing it for the next video.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="release--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>release</h4>
|
|
<pre>void release()</pre>
|
|
<div class="block">Releases the player. This method must be called when the player is no longer required.
|
|
<p>
|
|
The player must not be used after calling this method.</div>
|
|
</li>
|
|
</ul>
|
|
<a name="sendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>sendMessage</h4>
|
|
<pre>void sendMessage(<a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer">ExoPlayer.ExoPlayerComponent</a> target,
|
|
int messageType,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> message)</pre>
|
|
<div class="block">Sends a message to a specified component. The message is delivered to the component on the
|
|
playback thread. If the component throws a <a href="../../../../com/google/android/exoplayer/ExoPlaybackException.html" title="class in com.google.android.exoplayer"><code>ExoPlaybackException</code></a>, then it is
|
|
propagated out of the player as an error.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>target</code> - The target to which the message should be delivered.</dd>
|
|
<dd><code>messageType</code> - An integer that can be used to identify the type of the message.</dd>
|
|
<dd><code>message</code> - The message object.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="blockingSendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>blockingSendMessage</h4>
|
|
<pre>void blockingSendMessage(<a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer">ExoPlayer.ExoPlayerComponent</a> target,
|
|
int messageType,
|
|
<a href="http://docs.oracle.com/javase/7/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> message)</pre>
|
|
<div class="block">Blocking variant of <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#sendMessage-com.google.android.exoplayer.ExoPlayer.ExoPlayerComponent-int-java.lang.Object-"><code>sendMessage(ExoPlayerComponent, int, Object)</code></a> that does not return
|
|
until after the message has been delivered.</div>
|
|
<dl>
|
|
<dt><span class="paramLabel">Parameters:</span></dt>
|
|
<dd><code>target</code> - The target to which the message should be delivered.</dd>
|
|
<dd><code>messageType</code> - An integer that can be used to identify the type of the message.</dd>
|
|
<dd><code>message</code> - The message object.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getDuration--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getDuration</h4>
|
|
<pre>long getDuration()</pre>
|
|
<div class="block">Gets the duration of the track in milliseconds.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The duration of the track in milliseconds, or <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#UNKNOWN_TIME"><code>UNKNOWN_TIME</code></a> if the
|
|
duration is not known.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getCurrentPosition--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getCurrentPosition</h4>
|
|
<pre>long getCurrentPosition()</pre>
|
|
<div class="block">Gets the current playback position in milliseconds.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>The current playback position in milliseconds.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getBufferedPosition--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockList">
|
|
<li class="blockList">
|
|
<h4>getBufferedPosition</h4>
|
|
<pre>long getBufferedPosition()</pre>
|
|
<div class="block">Gets an estimate of the absolute position in milliseconds up to which data is buffered.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An estimate of the absolute position in milliseconds up to which data is buffered,
|
|
or <a href="../../../../com/google/android/exoplayer/ExoPlayer.html#UNKNOWN_TIME"><code>UNKNOWN_TIME</code></a> if no estimate is available.</dd>
|
|
</dl>
|
|
</li>
|
|
</ul>
|
|
<a name="getBufferedPercentage--">
|
|
<!-- -->
|
|
</a>
|
|
<ul class="blockListLast">
|
|
<li class="blockList">
|
|
<h4>getBufferedPercentage</h4>
|
|
<pre>int getBufferedPercentage()</pre>
|
|
<div class="block">Gets an estimate of the percentage into the media up to which data is buffered.</div>
|
|
<dl>
|
|
<dt><span class="returnLabel">Returns:</span></dt>
|
|
<dd>An estimate of the percentage into the media up to which data is buffered. 0 if the
|
|
duration of the media is not known or if no estimate is available.</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/exoplayer/ExoPlaybackException.html" title="class in com.google.android.exoplayer"><span class="typeNameLink">Prev Class</span></a></li>
|
|
<li><a href="../../../../com/google/android/exoplayer/ExoPlayer.ExoPlayerComponent.html" title="interface in com.google.android.exoplayer"><span class="typeNameLink">Next Class</span></a></li>
|
|
</ul>
|
|
<ul class="navList">
|
|
<li><a href="../../../../index.html?com/google/android/exoplayer/ExoPlayer.html" target="_top">Frames</a></li>
|
|
<li><a href="ExoPlayer.html" target="_top">No Frames</a></li>
|
|
</ul>
|
|
<ul class="navList" id="allclasses_navbar_bottom">
|
|
<li><a href="../../../../allclasses-noframe.html">All 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>
|
|
</div>
|
|
<div>
|
|
<ul class="subNavList">
|
|
<li>Summary: </li>
|
|
<li><a href="#nested.class.summary">Nested</a> | </li>
|
|
<li><a href="#field.summary">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.summary">Method</a></li>
|
|
</ul>
|
|
<ul class="subNavList">
|
|
<li>Detail: </li>
|
|
<li><a href="#field.detail">Field</a> | </li>
|
|
<li>Constr | </li>
|
|
<li><a href="#method.detail">Method</a></li>
|
|
</ul>
|
|
</div>
|
|
<a name="skip.navbar.bottom">
|
|
<!-- -->
|
|
</a></div>
|
|
<!-- ======== END OF BOTTOM NAVBAR ======= -->
|
|
</body>
|
|
</html>
|