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
91a491ea
authored
Sep 11, 2020
by
bachinger
Committed by
Oliver Woodman
Sep 11, 2020
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
Add getMediaItemCount() and getMediaItemAt(int)
PiperOrigin-RevId: 331211708
parent
bff7ac0d
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
0 deletions
RELEASENOTES.md
library/core/src/main/java/com/google/android/exoplayer2/BasePlayer.java
library/core/src/main/java/com/google/android/exoplayer2/Player.java
RELEASENOTES.md
View file @
91a491ea
...
@@ -2,6 +2,8 @@
...
@@ -2,6 +2,8 @@
### dev-v2 (not yet released)
### dev-v2 (not yet released)
*
`Player`
:
*
add
`getMediaItemCount()`
and
`getMediaItemAt(int)`
.
*
Track selection:
*
Track selection:
*
Add option to specify multiple preferred audio or text languages.
*
Add option to specify multiple preferred audio or text languages.
*
Data sources:
*
Data sources:
...
...
library/core/src/main/java/com/google/android/exoplayer2/BasePlayer.java
View file @
91a491ea
...
@@ -186,6 +186,16 @@ public abstract class BasePlayer implements Player {
...
@@ -186,6 +186,16 @@ public abstract class BasePlayer implements Player {
}
}
@Override
@Override
public
int
getMediaItemCount
()
{
return
getCurrentTimeline
().
getWindowCount
();
}
@Override
public
MediaItem
getMediaItemAt
(
int
index
)
{
return
getCurrentTimeline
().
getWindow
(
index
,
window
).
mediaItem
;
}
@Override
@Nullable
@Nullable
public
final
Object
getCurrentManifest
()
{
public
final
Object
getCurrentManifest
()
{
Timeline
timeline
=
getCurrentTimeline
();
Timeline
timeline
=
getCurrentTimeline
();
...
...
library/core/src/main/java/com/google/android/exoplayer2/Player.java
View file @
91a491ea
...
@@ -1284,6 +1284,12 @@ public interface Player {
...
@@ -1284,6 +1284,12 @@ public interface Player {
@Nullable
@Nullable
MediaItem
getCurrentMediaItem
();
MediaItem
getCurrentMediaItem
();
/** Returns the number of {@link MediaItem media items} in the playlist. */
int
getMediaItemCount
();
/** Returns the {@link MediaItem} at the given index. */
MediaItem
getMediaItemAt
(
int
index
);
/**
/**
* Returns the duration of the current content window or ad in milliseconds, or {@link
* Returns the duration of the current content window or ad in milliseconds, or {@link
* C#TIME_UNSET} if the duration is not known.
* C#TIME_UNSET} if the duration is not known.
...
...
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