mirror of
https://github.com/androidx/media.git
synced 2025-04-30 06:46:50 +08:00
Copy the isPlaceholder flag into CurrentMediaItemOnlyTimeline
PiperOrigin-RevId: 726405776
This commit is contained in:
parent
cea67e8826
commit
f5e583332b
@ -1415,6 +1415,7 @@ import java.util.List;
|
|||||||
@Nullable private final MediaItem mediaItem;
|
@Nullable private final MediaItem mediaItem;
|
||||||
private final boolean isSeekable;
|
private final boolean isSeekable;
|
||||||
private final boolean isDynamic;
|
private final boolean isDynamic;
|
||||||
|
private final boolean isPlaceholder;
|
||||||
@Nullable private final MediaItem.LiveConfiguration liveConfiguration;
|
@Nullable private final MediaItem.LiveConfiguration liveConfiguration;
|
||||||
private final long durationUs;
|
private final long durationUs;
|
||||||
|
|
||||||
@ -1422,6 +1423,13 @@ import java.util.List;
|
|||||||
mediaItem = player.getCurrentMediaItem();
|
mediaItem = player.getCurrentMediaItem();
|
||||||
isSeekable = player.isCurrentMediaItemSeekable();
|
isSeekable = player.isCurrentMediaItemSeekable();
|
||||||
isDynamic = player.isCurrentMediaItemDynamic();
|
isDynamic = player.isCurrentMediaItemDynamic();
|
||||||
|
Timeline timeline = player.getCurrentTimeline();
|
||||||
|
isPlaceholder =
|
||||||
|
!timeline.isEmpty()
|
||||||
|
&& player
|
||||||
|
.getCurrentTimeline()
|
||||||
|
.getWindow(player.getCurrentMediaItemIndex(), new Window())
|
||||||
|
.isPlaceholder;
|
||||||
liveConfiguration =
|
liveConfiguration =
|
||||||
player.isCurrentMediaItemLive() ? MediaItem.LiveConfiguration.UNSET : null;
|
player.isCurrentMediaItemLive() ? MediaItem.LiveConfiguration.UNSET : null;
|
||||||
durationUs = msToUs(player.getContentDuration());
|
durationUs = msToUs(player.getContentDuration());
|
||||||
@ -1449,6 +1457,7 @@ import java.util.List;
|
|||||||
/* firstPeriodIndex= */ 0,
|
/* firstPeriodIndex= */ 0,
|
||||||
/* lastPeriodIndex= */ 0,
|
/* lastPeriodIndex= */ 0,
|
||||||
/* positionInFirstPeriodUs= */ 0);
|
/* positionInFirstPeriodUs= */ 0);
|
||||||
|
window.isPlaceholder = isPlaceholder;
|
||||||
return window;
|
return window;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1465,6 +1474,7 @@ import java.util.List;
|
|||||||
/* windowIndex= */ 0,
|
/* windowIndex= */ 0,
|
||||||
durationUs,
|
durationUs,
|
||||||
/* positionInWindowUs= */ 0);
|
/* positionInWindowUs= */ 0);
|
||||||
|
period.isPlaceholder = isPlaceholder;
|
||||||
return period;
|
return period;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user