Commit f599a9b8 by bachinger Committed by Tianyi Feng

Keep content timeline and ad playback states together

For multi-period live streams the content timeline for
which the global ad playback state has been split needs
to be kept together to not run into a race between
timeline refreshes and ad events.

PiperOrigin-RevId: 520358964
parent 4b7875fe
...@@ -16,6 +16,11 @@ ...@@ -16,6 +16,11 @@
* Add parameters to `LoadControl` methods `shouldStartPlayback` and * Add parameters to `LoadControl` methods `shouldStartPlayback` and
`onTracksSelected` that allow associating these methods with the `onTracksSelected` that allow associating these methods with the
relevant `MediaPeriod`. relevant `MediaPeriod`.
* Change signature of
`ServerSideAdInsertionMediaSource.setAdPlaybackStates(Map<Object,
AdPlaybackState>)` by adding a timeline parameter that contains the
periods with the UIDs used as keys in the map. This is required to avoid
concurrency issues with multi-period live streams.
* Audio: * Audio:
* Fix bug where some playbacks fail when tunneling is enabled and * Fix bug where some playbacks fail when tunneling is enabled and
`AudioProcessors` are active, e.g. for gapless trimming `AudioProcessors` are active, e.g. for gapless trimming
......
...@@ -92,8 +92,8 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -92,8 +92,8 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
* Called when the content source has refreshed the timeline. * Called when the content source has refreshed the timeline.
* *
* <p>If true is returned the source refresh publication is deferred, to wait for an {@link * <p>If true is returned the source refresh publication is deferred, to wait for an {@link
* #setAdPlaybackStates(ImmutableMap)} ad playback state update}. If false is returned, the * #setAdPlaybackStates(ImmutableMap, Timeline)} ad playback state update}. If false is
* source refresh is immediately published. * returned, the source refresh is immediately published.
* *
* <p>Called on the playback thread. * <p>Called on the playback thread.
* *
...@@ -115,7 +115,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -115,7 +115,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
private Handler playbackHandler; private Handler playbackHandler;
@Nullable private SharedMediaPeriod lastUsedMediaPeriod; @Nullable private SharedMediaPeriod lastUsedMediaPeriod;
@Nullable private Timeline contentTimeline;
private ImmutableMap<Object, AdPlaybackState> adPlaybackStates; private ImmutableMap<Object, AdPlaybackState> adPlaybackStates;
/** /**
...@@ -139,8 +138,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -139,8 +138,7 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
/** /**
* Sets the map of {@link AdPlaybackState ad playback states} published by this source. The key is * Sets the map of {@link AdPlaybackState ad playback states} published by this source. The key is
* the period UID of a period in the {@link * the period UID of a period in the {@code contentTimeline}.
* AdPlaybackStateUpdater#onAdPlaybackStateUpdateRequested(Timeline)} content timeline}.
* *
* <p>Each period has an {@link AdPlaybackState} that tells where in the period the ad groups * <p>Each period has an {@link AdPlaybackState} that tells where in the period the ad groups
* start and end. Must only contain server-side inserted ad groups. The number of ad groups and * start and end. Must only contain server-side inserted ad groups. The number of ad groups and
...@@ -151,8 +149,11 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -151,8 +149,11 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
* <p>May be called from any thread. * <p>May be called from any thread.
* *
* @param adPlaybackStates The map of {@link AdPlaybackState} keyed by their period UID. * @param adPlaybackStates The map of {@link AdPlaybackState} keyed by their period UID.
* @param contentTimeline The content timeline containing the periods with the UIDs used as keys
* in the map of playback states.
*/ */
public void setAdPlaybackStates(ImmutableMap<Object, AdPlaybackState> adPlaybackStates) { public void setAdPlaybackStates(
ImmutableMap<Object, AdPlaybackState> adPlaybackStates, Timeline contentTimeline) {
checkArgument(!adPlaybackStates.isEmpty()); checkArgument(!adPlaybackStates.isEmpty());
Object adsId = checkNotNull(adPlaybackStates.values().asList().get(0).adsId); Object adsId = checkNotNull(adPlaybackStates.values().asList().get(0).adsId);
for (Map.Entry<Object, AdPlaybackState> entry : adPlaybackStates.entrySet()) { for (Map.Entry<Object, AdPlaybackState> entry : adPlaybackStates.entrySet()) {
...@@ -188,7 +189,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -188,7 +189,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
if (playbackHandler == null) { if (playbackHandler == null) {
this.adPlaybackStates = adPlaybackStates; this.adPlaybackStates = adPlaybackStates;
} else { } else {
Timeline finalContentTimeline = contentTimeline;
playbackHandler.post( playbackHandler.post(
() -> { () -> {
for (SharedMediaPeriod mediaPeriod : mediaPeriods.values()) { for (SharedMediaPeriod mediaPeriod : mediaPeriods.values()) {
...@@ -207,10 +207,8 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -207,10 +207,8 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
} }
} }
this.adPlaybackStates = adPlaybackStates; this.adPlaybackStates = adPlaybackStates;
if (finalContentTimeline != null) {
refreshSourceInfo( refreshSourceInfo(
new ServerSideAdInsertionTimeline(finalContentTimeline, adPlaybackStates)); new ServerSideAdInsertionTimeline(contentTimeline, adPlaybackStates));
}
}); });
} }
} }
...@@ -250,7 +248,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -250,7 +248,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
@Override @Override
public void onSourceInfoRefreshed(MediaSource source, Timeline timeline) { public void onSourceInfoRefreshed(MediaSource source, Timeline timeline) {
this.contentTimeline = timeline;
if ((adPlaybackStateUpdater == null if ((adPlaybackStateUpdater == null
|| !adPlaybackStateUpdater.onAdPlaybackStateUpdateRequested(timeline)) || !adPlaybackStateUpdater.onAdPlaybackStateUpdateRequested(timeline))
&& !adPlaybackStates.isEmpty()) { && !adPlaybackStates.isEmpty()) {
...@@ -261,7 +258,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource ...@@ -261,7 +258,6 @@ public final class ServerSideAdInsertionMediaSource extends BaseMediaSource
@Override @Override
protected void releaseSourceInternal() { protected void releaseSourceInternal() {
releaseLastUsedMediaPeriod(); releaseLastUsedMediaPeriod();
contentTimeline = null;
synchronized (this) { synchronized (this) {
playbackHandler = null; playbackHandler = null;
} }
......
...@@ -17,6 +17,7 @@ package androidx.media3.exoplayer; ...@@ -17,6 +17,7 @@ package androidx.media3.exoplayer;
import static androidx.media3.test.utils.ExoPlayerTestRunner.AUDIO_FORMAT; import static androidx.media3.test.utils.ExoPlayerTestRunner.AUDIO_FORMAT;
import static androidx.media3.test.utils.ExoPlayerTestRunner.VIDEO_FORMAT; import static androidx.media3.test.utils.ExoPlayerTestRunner.VIDEO_FORMAT;
import static androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_DURATION_US;
import static androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US; import static androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US;
import static com.google.common.truth.Truth.assertThat; import static com.google.common.truth.Truth.assertThat;
import static java.util.concurrent.TimeUnit.SECONDS; import static java.util.concurrent.TimeUnit.SECONDS;
...@@ -57,6 +58,7 @@ import androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition; ...@@ -57,6 +58,7 @@ import androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.common.collect.ImmutableList; import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
import java.util.concurrent.CountDownLatch; import java.util.concurrent.CountDownLatch;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import org.junit.Before; import org.junit.Before;
...@@ -1568,13 +1570,28 @@ public final class MediaPeriodQueueTest { ...@@ -1568,13 +1570,28 @@ public final class MediaPeriodQueueTest {
private static Timeline createMultiPeriodServerSideInsertedTimeline( private static Timeline createMultiPeriodServerSideInsertedTimeline(
Object windowId, int numberOfPlayedAds, boolean... isAdPeriodFlags) Object windowId, int numberOfPlayedAds, boolean... isAdPeriodFlags)
throws InterruptedException { throws InterruptedException {
FakeTimeline timeline = FakeTimeline fakeContentTimeline =
FakeTimeline.createMultiPeriodAdTimeline(windowId, numberOfPlayedAds, isAdPeriodFlags); new FakeTimeline(
new TimelineWindowDefinition(
isAdPeriodFlags.length,
windowId,
/* isSeekable= */ true,
/* isDynamic= */ false,
/* isLive= */ false,
/* isPlaceholder= */ false,
/* durationUs= */ DEFAULT_WINDOW_DURATION_US,
/* defaultPositionUs= */ 0,
/* windowOffsetInFirstPeriodUs= */ DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US,
/* adPlaybackStates= */ ImmutableList.of(AdPlaybackState.NONE),
MediaItem.EMPTY));
ImmutableMap<Object, AdPlaybackState> adPlaybackStates =
FakeTimeline.createMultiPeriodAdTimeline(windowId, numberOfPlayedAds, isAdPeriodFlags)
.getAdPlaybackStates(/* windowIndex= */ 0);
ServerSideAdInsertionMediaSource serverSideAdInsertionMediaSource = ServerSideAdInsertionMediaSource serverSideAdInsertionMediaSource =
new ServerSideAdInsertionMediaSource( new ServerSideAdInsertionMediaSource(
new FakeMediaSource(timeline, VIDEO_FORMAT, AUDIO_FORMAT), contentTimeline -> false); new FakeMediaSource(fakeContentTimeline, VIDEO_FORMAT, AUDIO_FORMAT),
serverSideAdInsertionMediaSource.setAdPlaybackStates( contentTimeline -> false);
timeline.getAdPlaybackStates(/* windowIndex= */ 0)); serverSideAdInsertionMediaSource.setAdPlaybackStates(adPlaybackStates, fakeContentTimeline);
AtomicReference<Timeline> serverSideAdInsertionTimelineRef = new AtomicReference<>(); AtomicReference<Timeline> serverSideAdInsertionTimelineRef = new AtomicReference<>();
CountDownLatch countDownLatch = new CountDownLatch(/* count= */ 1); CountDownLatch countDownLatch = new CountDownLatch(/* count= */ 1);
serverSideAdInsertionMediaSource.prepareSource( serverSideAdInsertionMediaSource.prepareSource(
......
...@@ -55,6 +55,7 @@ import androidx.media3.test.utils.robolectric.ShadowMediaCodecConfig; ...@@ -55,6 +55,7 @@ import androidx.media3.test.utils.robolectric.ShadowMediaCodecConfig;
import androidx.test.core.app.ApplicationProvider; import androidx.test.core.app.ApplicationProvider;
import androidx.test.ext.junit.runners.AndroidJUnit4; import androidx.test.ext.junit.runners.AndroidJUnit4;
import com.google.common.collect.ImmutableMap; import com.google.common.collect.ImmutableMap;
import java.util.ArrayList;
import java.util.concurrent.atomic.AtomicReference; import java.util.concurrent.atomic.AtomicReference;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Rule; import org.junit.Rule;
...@@ -110,7 +111,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -110,7 +111,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
.withContentResumeOffsetUs(/* adGroupIndex= */ 1, /* contentResumeOffsetUs= */ 400_000) .withContentResumeOffsetUs(/* adGroupIndex= */ 1, /* contentResumeOffsetUs= */ 400_000)
.withContentResumeOffsetUs(/* adGroupIndex= */ 2, /* contentResumeOffsetUs= */ 200_000); .withContentResumeOffsetUs(/* adGroupIndex= */ 2, /* contentResumeOffsetUs= */ 200_000);
AtomicReference<Timeline> timelineReference = new AtomicReference<>(); AtomicReference<Timeline> timelineReference = new AtomicReference<>();
mediaSource.setAdPlaybackStates(ImmutableMap.of(new Pair<>(0, 0), adPlaybackState)); mediaSource.setAdPlaybackStates(
ImmutableMap.of(new Pair<>(0, 0), adPlaybackState), wrappedTimeline);
mediaSource.prepareSource( mediaSource.prepareSource(
(source, timeline) -> timelineReference.set(timeline), (source, timeline) -> timelineReference.set(timeline),
...@@ -191,7 +193,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -191,7 +193,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
wrappedTimeline.getPeriod( wrappedTimeline.getPeriod(
/* periodIndex= */ 0, new Timeline.Period(), /* setIds= */ true) /* periodIndex= */ 0, new Timeline.Period(), /* setIds= */ true)
.uid, .uid,
adPlaybackState)); adPlaybackState),
wrappedTimeline);
mediaSource.prepareSource( mediaSource.prepareSource(
(source, timeline) -> timelineReference.set(timeline), (source, timeline) -> timelineReference.set(timeline),
...@@ -231,12 +234,13 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -231,12 +234,13 @@ public final class ServerSideAdInsertionMediaSourceTest {
@Test @Test
public void timeline_missingAdPlaybackStateByPeriodUid_isAssertedAndThrows() { public void timeline_missingAdPlaybackStateByPeriodUid_isAssertedAndThrows() {
FakeMediaSource contentSource = new FakeMediaSource();
ServerSideAdInsertionMediaSource mediaSource = ServerSideAdInsertionMediaSource mediaSource =
new ServerSideAdInsertionMediaSource( new ServerSideAdInsertionMediaSource(contentSource, /* adPlaybackStateUpdater= */ null);
new FakeMediaSource(), /* adPlaybackStateUpdater= */ null);
// The map of adPlaybackStates does not contain a valid period UID as key. // The map of adPlaybackStates does not contain a valid period UID as key.
mediaSource.setAdPlaybackStates( mediaSource.setAdPlaybackStates(
ImmutableMap.of(new Object(), new AdPlaybackState(/* adsId= */ new Object()))); ImmutableMap.of(new Object(), new AdPlaybackState(/* adsId= */ new Object())),
contentSource.getInitialTimeline());
Assert.assertThrows( Assert.assertThrows(
IllegalStateException.class, IllegalStateException.class,
...@@ -292,7 +296,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -292,7 +296,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
.uid); .uid);
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid, firstAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid, firstAdPlaybackState), contentTimeline);
return true; return true;
})); }));
...@@ -338,6 +343,7 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -338,6 +343,7 @@ public final class ServerSideAdInsertionMediaSourceTest {
/* contentResumeOffsetUs= */ 0, /* contentResumeOffsetUs= */ 0,
/* adDurationsUs...= */ 100_000); /* adDurationsUs...= */ 100_000);
AtomicReference<ServerSideAdInsertionMediaSource> mediaSourceRef = new AtomicReference<>(); AtomicReference<ServerSideAdInsertionMediaSource> mediaSourceRef = new AtomicReference<>();
ArrayList<Timeline> contentTimelines = new ArrayList<>();
mediaSourceRef.set( mediaSourceRef.set(
new ServerSideAdInsertionMediaSource( new ServerSideAdInsertionMediaSource(
new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(TEST_ASSET)), new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(TEST_ASSET)),
...@@ -347,9 +353,11 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -347,9 +353,11 @@ public final class ServerSideAdInsertionMediaSourceTest {
contentTimeline.getPeriod( contentTimeline.getPeriod(
/* periodIndex= */ 0, new Timeline.Period(), /* setIds= */ true) /* periodIndex= */ 0, new Timeline.Period(), /* setIds= */ true)
.uid)); .uid));
contentTimelines.add(contentTimeline);
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid.get(), firstAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid.get(), firstAdPlaybackState), contentTimeline);
return true; return true;
})); }));
AnalyticsListener listener = mock(AnalyticsListener.class); AnalyticsListener listener = mock(AnalyticsListener.class);
...@@ -367,7 +375,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -367,7 +375,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
/* adDurationsUs...= */ 500_000); /* adDurationsUs...= */ 500_000);
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid.get(), secondAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid.get(), secondAdPlaybackState), contentTimelines.get(1));
runUntilPendingCommandsAreFullyHandled(player); runUntilPendingCommandsAreFullyHandled(player);
player.play(); player.play();
...@@ -376,6 +385,7 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -376,6 +385,7 @@ public final class ServerSideAdInsertionMediaSourceTest {
// Assert all samples have been played. // Assert all samples have been played.
DumpFileAsserts.assertOutput(context, playbackOutput, TEST_ASSET_DUMP); DumpFileAsserts.assertOutput(context, playbackOutput, TEST_ASSET_DUMP);
assertThat(contentTimelines).hasSize(2);
// Assert playback has been reported with ads: [content][ad0][content][ad1][content] // Assert playback has been reported with ads: [content][ad0][content][ad1][content]
// 5*2(audio+video) format changes, 4 discontinuities between parts. // 5*2(audio+video) format changes, 4 discontinuities between parts.
verify(listener, times(4)) verify(listener, times(4))
...@@ -409,10 +419,12 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -409,10 +419,12 @@ public final class ServerSideAdInsertionMediaSourceTest {
/* contentResumeOffsetUs= */ 0, /* contentResumeOffsetUs= */ 0,
/* adDurationsUs...= */ 500_000); /* adDurationsUs...= */ 500_000);
AtomicReference<ServerSideAdInsertionMediaSource> mediaSourceRef = new AtomicReference<>(); AtomicReference<ServerSideAdInsertionMediaSource> mediaSourceRef = new AtomicReference<>();
ArrayList<Timeline> contentTimelines = new ArrayList<>();
mediaSourceRef.set( mediaSourceRef.set(
new ServerSideAdInsertionMediaSource( new ServerSideAdInsertionMediaSource(
new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(TEST_ASSET)), new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(TEST_ASSET)),
/* adPlaybackStateUpdater= */ contentTimeline -> { /* adPlaybackStateUpdater= */ contentTimeline -> {
contentTimelines.add(contentTimeline);
if (periodUid.get() == null) { if (periodUid.get() == null) {
periodUid.set( periodUid.set(
checkNotNull( checkNotNull(
...@@ -421,7 +433,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -421,7 +433,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
.uid)); .uid));
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid.get(), firstAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid.get(), firstAdPlaybackState), contentTimeline);
} }
return true; return true;
})); }));
...@@ -440,7 +453,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -440,7 +453,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
/* adGroupIndex= */ 0, /* adDurationsUs...= */ 50_000, 250_000, 200_000); /* adGroupIndex= */ 0, /* adDurationsUs...= */ 50_000, 250_000, 200_000);
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid.get(), secondAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid.get(), secondAdPlaybackState), contentTimelines.get(1));
runUntilPendingCommandsAreFullyHandled(player); runUntilPendingCommandsAreFullyHandled(player);
player.play(); player.play();
...@@ -449,6 +463,7 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -449,6 +463,7 @@ public final class ServerSideAdInsertionMediaSourceTest {
// Assert all samples have been played. // Assert all samples have been played.
DumpFileAsserts.assertOutput(context, playbackOutput, TEST_ASSET_DUMP); DumpFileAsserts.assertOutput(context, playbackOutput, TEST_ASSET_DUMP);
assertThat(contentTimelines).hasSize(2);
// Assert playback has been reported with ads: [ad0][ad1][ad2][content] // Assert playback has been reported with ads: [ad0][ad1][ad2][content]
// 4*2(audio+video) format changes, 3 discontinuities between parts. // 4*2(audio+video) format changes, 3 discontinuities between parts.
verify(listener, times(3)) verify(listener, times(3))
...@@ -501,7 +516,8 @@ public final class ServerSideAdInsertionMediaSourceTest { ...@@ -501,7 +516,8 @@ public final class ServerSideAdInsertionMediaSourceTest {
.uid); .uid);
mediaSourceRef mediaSourceRef
.get() .get()
.setAdPlaybackStates(ImmutableMap.of(periodUid, firstAdPlaybackState)); .setAdPlaybackStates(
ImmutableMap.of(periodUid, firstAdPlaybackState), contentTimeline);
return true; return true;
})); }));
......
...@@ -702,7 +702,8 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou ...@@ -702,7 +702,8 @@ public final class ImaServerSideAdInsertionMediaSource extends CompositeMediaSou
splitAdPlaybackStates = ImmutableMap.of(periodUid, adPlaybackState); splitAdPlaybackStates = ImmutableMap.of(periodUid, adPlaybackState);
} }
streamPlayer.setAdPlaybackStates(adsId, splitAdPlaybackStates, contentTimeline); streamPlayer.setAdPlaybackStates(adsId, splitAdPlaybackStates, contentTimeline);
checkNotNull(serverSideAdInsertionMediaSource).setAdPlaybackStates(splitAdPlaybackStates); checkNotNull(serverSideAdInsertionMediaSource)
.setAdPlaybackStates(splitAdPlaybackStates, contentTimeline);
if (!isLiveStream) { if (!isLiveStream) {
adsLoader.setAdPlaybackState(adsId, adPlaybackState); adsLoader.setAdPlaybackState(adsId, adPlaybackState);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment