Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
SDK
/
exoplayer
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
a987e106
authored
Nov 20, 2020
by
tonihei
Committed by
Ian Baker
Nov 23, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Update docs with onEvents callback information.
PiperOrigin-RevId: 343507207
parent
1b50071f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
library/core/src/main/java/com/google/android/exoplayer2/Player.java
library/core/src/main/java/com/google/android/exoplayer2/analytics/AnalyticsListener.java
library/core/src/main/java/com/google/android/exoplayer2/Player.java
View file @
a987e106
...
@@ -644,13 +644,15 @@ public interface Player {
...
@@ -644,13 +644,15 @@ public interface Player {
* <p>Listeners should prefer this method over individual callbacks in the following cases:
* <p>Listeners should prefer this method over individual callbacks in the following cases:
*
*
* <ul>
* <ul>
* <li>They intend to use multiple state values together (e.g. using {@link
* <li>They intend to trigger the same logic for multiple events (e.g. when updating a UI for
* #getCurrentWindowIndex()} to query in {@link #getCurrentTimeline()}).
* <li>The same logic should be triggered for multiple events (e.g. when updating a UI for
* both {@link #onPlaybackStateChanged(int)} and {@link #onPlayWhenReadyChanged(boolean,
* both {@link #onPlaybackStateChanged(int)} and {@link #onPlayWhenReadyChanged(boolean,
* int)}).
* int)}).
* <li>They need access to the {@link Player} object to trigger further events (e.g. to call
* <li>They need access to the {@link Player} object to trigger further events (e.g. to call
* {@link Player#seekTo(long)} after a {@link #onMediaItemTransition(MediaItem, int)}).
* {@link Player#seekTo(long)} after a {@link #onMediaItemTransition(MediaItem, int)}).
* <li>They intend to use multiple state values together or in combination with {@link Player}
* getter methods. For example using {@link #getCurrentWindowIndex()} with the {@code
* timeline} provided in {@link #onTimelineChanged(Timeline, int)} is only safe from
* within this method.
* <li>They are interested in events that logically happened together (e.g {@link
* <li>They are interested in events that logically happened together (e.g {@link
* #onPlaybackStateChanged(int)} to {@link #STATE_BUFFERING} because of {@link
* #onPlaybackStateChanged(int)} to {@link #STATE_BUFFERING} because of {@link
* #onMediaItemTransition(MediaItem, int)}).
* #onMediaItemTransition(MediaItem, int)}).
...
...
library/core/src/main/java/com/google/android/exoplayer2/analytics/AnalyticsListener.java
View file @
a987e106
...
@@ -975,14 +975,16 @@ public interface AnalyticsListener {
...
@@ -975,14 +975,16 @@ public interface AnalyticsListener {
* <p>Listeners should prefer this method over individual callbacks in the following cases:
* <p>Listeners should prefer this method over individual callbacks in the following cases:
*
*
* <ul>
* <ul>
* <li>They intend to use multiple state values together (e.g. using {@link
* <li>They intend to trigger the same logic for multiple events (e.g. when updating a UI for
* Player#getCurrentWindowIndex()} to query in {@link Player#getCurrentTimeline()}).
* both {@link #onPlaybackStateChanged(EventTime, int)} and {@link
* <li>The same logic should be triggered for multiple events (e.g. when updating a UI for both
* {@link #onPlaybackStateChanged(EventTime, int)} and {@link
* #onPlayWhenReadyChanged(EventTime, boolean, int)}).
* #onPlayWhenReadyChanged(EventTime, boolean, int)}).
* <li>They need access to the {@link Player} object to trigger further events (e.g. to call
* <li>They need access to the {@link Player} object to trigger further events (e.g. to call
* {@link Player#seekTo(long)} after a {@link
* {@link Player#seekTo(long)} after a {@link
* AnalyticsListener#onMediaItemTransition(EventTime, MediaItem, int)}).
* AnalyticsListener#onMediaItemTransition(EventTime, MediaItem, int)}).
* <li>They intend to use multiple state values together or in combination with {@link Player}
* getter methods. For example using {@link Player#getCurrentWindowIndex()} with the {@code
* timeline} provided in {@link #onTimelineChanged(EventTime, int)} is only safe from within
* this method.
* <li>They are interested in events that logically happened together (e.g {@link
* <li>They are interested in events that logically happened together (e.g {@link
* #onPlaybackStateChanged(EventTime, int)} to {@link Player#STATE_BUFFERING} because of
* #onPlaybackStateChanged(EventTime, int)} to {@link Player#STATE_BUFFERING} because of
* {@link #onMediaItemTransition(EventTime, MediaItem, int)}).
* {@link #onMediaItemTransition(EventTime, MediaItem, int)}).
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment