use of androidx.media3.exoplayer.source.ForwardingTimeline in project media by androidx.
the class ProgressiveMediaSource method notifySourceInfoRefreshed.
// Internal methods.
private void notifySourceInfoRefreshed() {
// TODO: Split up isDynamic into multiple fields to indicate which values may change. Then
// indicate that the duration may change until it's known. See [internal: b/69703223].
Timeline timeline = new SinglePeriodTimeline(timelineDurationUs, timelineIsSeekable, /* isDynamic= */
false, /* useLiveConfiguration= */
timelineIsLive, /* manifest= */
null, mediaItem);
if (timelineIsPlaceholder) {
// TODO: Actually prepare the extractors during preparation so that we don't need a
// placeholder. See https://github.com/google/ExoPlayer/issues/4727.
timeline = new ForwardingTimeline(timeline) {
@Override
public Window getWindow(int windowIndex, Window window, long defaultPositionProjectionUs) {
super.getWindow(windowIndex, window, defaultPositionProjectionUs);
window.isPlaceholder = true;
return window;
}
@Override
public Period getPeriod(int periodIndex, Period period, boolean setIds) {
super.getPeriod(periodIndex, period, setIds);
period.isPlaceholder = true;
return period;
}
};
}
refreshSourceInfo(timeline);
}
use of androidx.media3.exoplayer.source.ForwardingTimeline in project media by androidx.
the class RtspMediaSource method notifySourceInfoRefreshed.
// Internal methods.
private void notifySourceInfoRefreshed() {
Timeline timeline = new SinglePeriodTimeline(timelineDurationUs, timelineIsSeekable, /* isDynamic= */
false, /* useLiveConfiguration= */
timelineIsLive, /* manifest= */
null, mediaItem);
if (timelineIsPlaceholder) {
timeline = new ForwardingTimeline(timeline) {
@Override
public Window getWindow(int windowIndex, Window window, long defaultPositionProjectionUs) {
super.getWindow(windowIndex, window, defaultPositionProjectionUs);
window.isPlaceholder = true;
return window;
}
@Override
public Period getPeriod(int periodIndex, Period period, boolean setIds) {
super.getPeriod(periodIndex, period, setIds);
period.isPlaceholder = true;
return period;
}
};
}
refreshSourceInfo(timeline);
}
Aggregations