Use withLivePostrollPlaeholderAppended to add placeholder

PiperOrigin-RevId: 525177113
This commit is contained in:
bachinger 2023-04-18 18:01:14 +01:00 committed by Rohit Singh
parent 07ff3eeead
commit 85fb32d70f

View File

@ -743,11 +743,9 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
contentMediaSourceFactory.createMediaSource(contentMediaItem), componentListener);
this.serverSideAdInsertionMediaSource = serverSideAdInsertionMediaSource;
if (isLiveStream) {
AdPlaybackState liveAdPlaybackState =
new AdPlaybackState(adsId)
.withNewAdGroup(/* adGroupIndex= */ 0, /* adGroupTimeUs= */ C.TIME_END_OF_SOURCE)
.withIsServerSideInserted(/* adGroupIndex= */ 0, true);
mainHandler.post(() -> setAdPlaybackState(liveAdPlaybackState));
mainHandler.post(
() ->
setAdPlaybackState(new AdPlaybackState(adsId).withLivePostrollPlaceholderAppended()));
}
prepareChildSource(/* id= */ null, serverSideAdInsertionMediaSource);
}