mirror of
https://github.com/samsonjs/media.git
synced 2026-03-27 09:45:47 +00:00
Replace isTopLevelSource check by period count check in AdsMediaSource.
The top level requirement only tried to ensure that the entire timeline only has one period. This is already asserted by ImaAdsLoader. AdsMediaSource itself works fine as long as the wrapped timeline has one period only. This is now asserted instead. PiperOrigin-RevId: 227682141
This commit is contained in:
parent
e4ad90efd0
commit
c130723929
1 changed files with 1 additions and 3 deletions
|
|
@ -331,9 +331,6 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
|
|||
boolean isTopLevelSource,
|
||||
@Nullable TransferListener mediaTransferListener) {
|
||||
super.prepareSourceInternal(player, isTopLevelSource, mediaTransferListener);
|
||||
Assertions.checkArgument(
|
||||
isTopLevelSource,
|
||||
"AdsMediaSource must be the top-level source used to prepare the player.");
|
||||
final ComponentListener componentListener = new ComponentListener();
|
||||
this.componentListener = componentListener;
|
||||
prepareChildSource(DUMMY_CONTENT_MEDIA_PERIOD_ID, contentMediaSource);
|
||||
|
|
@ -444,6 +441,7 @@ public final class AdsMediaSource extends CompositeMediaSource<MediaPeriodId> {
|
|||
}
|
||||
|
||||
private void onContentSourceInfoRefreshed(Timeline timeline, Object manifest) {
|
||||
Assertions.checkArgument(timeline.getPeriodCount() == 1);
|
||||
contentTimeline = timeline;
|
||||
contentManifest = manifest;
|
||||
maybeUpdateSourceInfo();
|
||||
|
|
|
|||
Loading…
Reference in a new issue