mirror of
https://github.com/samsonjs/media.git
synced 2026-04-12 12:25:47 +00:00
Add getMediaItemCount() and getMediaItemAt(int)
PiperOrigin-RevId: 331211708
This commit is contained in:
parent
bff7ac0dbe
commit
91a491ea31
3 changed files with 18 additions and 0 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
### dev-v2 (not yet released)
|
||||
|
||||
* `Player`:
|
||||
* add `getMediaItemCount()` and `getMediaItemAt(int)`.
|
||||
* Track selection:
|
||||
* Add option to specify multiple preferred audio or text languages.
|
||||
* Data sources:
|
||||
|
|
|
|||
|
|
@ -185,6 +185,16 @@ public abstract class BasePlayer implements Player {
|
|||
: timeline.getWindow(getCurrentWindowIndex(), window).mediaItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMediaItemCount() {
|
||||
return getCurrentTimeline().getWindowCount();
|
||||
}
|
||||
|
||||
@Override
|
||||
public MediaItem getMediaItemAt(int index) {
|
||||
return getCurrentTimeline().getWindow(index, window).mediaItem;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public final Object getCurrentManifest() {
|
||||
|
|
|
|||
|
|
@ -1284,6 +1284,12 @@ public interface Player {
|
|||
@Nullable
|
||||
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
|
||||
* C#TIME_UNSET} if the duration is not known.
|
||||
|
|
|
|||
Loading…
Reference in a new issue