Search in sources :

Example 31 with AdPlaybackState

use of com.google.android.exoplayer2.source.ads.AdPlaybackState in project ExoPlayer by google.

the class ExoPlayerTest method adInMovingLiveWindow_keepsContentPosition.

@Test
public void adInMovingLiveWindow_keepsContentPosition() throws Exception {
    ExoPlayer player = new TestExoPlayerBuilder(context).build();
    AdPlaybackState adPlaybackState = FakeTimeline.createAdPlaybackState(/* adsPerAdGroup= */
    1, /* adGroupTimesUs...= */
    42_000_004_000_000L);
    Timeline liveTimeline1 = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    10_000_000, /* defaultPositionUs= */
    3_000_000, /* windowOffsetInFirstPeriodUs= */
    42_000_000_000_000L, adPlaybackState));
    Timeline liveTimeline2 = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    10_000_000, /* defaultPositionUs= */
    3_000_000, /* windowOffsetInFirstPeriodUs= */
    42_000_002_000_000L, adPlaybackState));
    FakeMediaSource fakeMediaSource = new FakeMediaSource(liveTimeline1);
    player.setMediaSource(fakeMediaSource);
    player.prepare();
    player.play();
    // Wait until the ad is playing.
    runUntilPositionDiscontinuity(player, Player.DISCONTINUITY_REASON_AUTO_TRANSITION);
    long contentPositionBeforeLiveWindowUpdateMs = player.getContentPosition();
    fakeMediaSource.setNewSourceInfo(liveTimeline2);
    runUntilTimelineChanged(player);
    long contentPositionAfterLiveWindowUpdateMs = player.getContentPosition();
    player.release();
    assertThat(contentPositionBeforeLiveWindowUpdateMs).isEqualTo(4000);
    assertThat(contentPositionAfterLiveWindowUpdateMs).isEqualTo(2000);
}
Also used : NoUidTimeline(com.google.android.exoplayer2.testutil.NoUidTimeline) SinglePeriodTimeline(com.google.android.exoplayer2.source.SinglePeriodTimeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) FakeMediaSource(com.google.android.exoplayer2.testutil.FakeMediaSource) AdPlaybackState(com.google.android.exoplayer2.source.ads.AdPlaybackState) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) TimelineWindowDefinition(com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition) TestExoPlayerBuilder(com.google.android.exoplayer2.testutil.TestExoPlayerBuilder) Test(org.junit.Test)

Example 32 with AdPlaybackState

use of com.google.android.exoplayer2.source.ads.AdPlaybackState in project ExoPlayer by google.

the class ExoPlayerTest method seekTo_whilePlayingAd_doesntBlockFutureUpdates.

// https://github.com/google/ExoPlayer/issues/8349
@Test
public void seekTo_whilePlayingAd_doesntBlockFutureUpdates() throws Exception {
    long contentDurationMs = 10_000;
    long adDurationMs = 4_000;
    AdPlaybackState adPlaybackState = new AdPlaybackState(/* adsId= */
    new Object(), /* adGroupTimesUs...= */
    0).withAdCount(/* adGroupIndex= */
    0, /* adCount= */
    1).withAdUri(/* adGroupIndex= */
    0, /* adIndexInAdGroup= */
    0, Uri.EMPTY);
    long[][] durationsUs = new long[1][];
    durationsUs[0] = new long[] { Util.msToUs(adDurationMs) };
    adPlaybackState = adPlaybackState.withAdDurationsUs(durationsUs);
    Timeline adTimeline = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    false, /* durationUs= */
    Util.msToUs(contentDurationMs), adPlaybackState));
    FakeMediaSource adsMediaSource = new FakeMediaSource(adTimeline);
    ExoPlayer player = new TestExoPlayerBuilder(context).build();
    player.setMediaSource(adsMediaSource);
    player.pause();
    player.prepare();
    runUntilPlaybackState(player, Player.STATE_READY);
    player.seekTo(0, 8000);
    player.play();
    // This times out if playback info updates after the seek are blocked.
    runUntilPlaybackState(player, Player.STATE_ENDED);
}
Also used : NoUidTimeline(com.google.android.exoplayer2.testutil.NoUidTimeline) SinglePeriodTimeline(com.google.android.exoplayer2.source.SinglePeriodTimeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) FakeMediaSource(com.google.android.exoplayer2.testutil.FakeMediaSource) AdPlaybackState(com.google.android.exoplayer2.source.ads.AdPlaybackState) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) TimelineWindowDefinition(com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition) TestExoPlayerBuilder(com.google.android.exoplayer2.testutil.TestExoPlayerBuilder) Test(org.junit.Test)

Example 33 with AdPlaybackState

use of com.google.android.exoplayer2.source.ads.AdPlaybackState in project ExoPlayer by google.

the class ExoPlayerTest method seekTo_whilePlayingAd_correctMasking.

@Test
public void seekTo_whilePlayingAd_correctMasking() throws Exception {
    long contentDurationMs = 10_000;
    long adDurationMs = 4_000;
    AdPlaybackState adPlaybackState = new AdPlaybackState(/* adsId= */
    new Object(), /* adGroupTimesUs...= */
    0);
    adPlaybackState = adPlaybackState.withAdCount(/* adGroupIndex= */
    0, /* adCount= */
    1);
    adPlaybackState = adPlaybackState.withAdUri(/* adGroupIndex= */
    0, /* adIndexInAdGroup= */
    0, Uri.EMPTY);
    long[][] durationsUs = new long[1][];
    durationsUs[0] = new long[] { Util.msToUs(adDurationMs) };
    adPlaybackState = adPlaybackState.withAdDurationsUs(durationsUs);
    Timeline adTimeline = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    false, /* durationUs= */
    Util.msToUs(contentDurationMs), adPlaybackState));
    FakeMediaSource adsMediaSource = new FakeMediaSource(adTimeline);
    int[] mediaItemIndex = new int[] { C.INDEX_UNSET, C.INDEX_UNSET };
    long[] positionMs = new long[] { C.TIME_UNSET, C.TIME_UNSET };
    long[] bufferedPositionMs = new long[] { C.TIME_UNSET, C.TIME_UNSET };
    long[] totalBufferedDurationMs = new long[] { C.TIME_UNSET, C.TIME_UNSET };
    boolean[] isPlayingAd = new boolean[2];
    ActionSchedule actionSchedule = new ActionSchedule.Builder(TAG).pause().waitForPlaybackState(Player.STATE_READY).waitForIsLoading(true).waitForIsLoading(false).executeRunnable(new PlayerRunnable() {

        @Override
        public void run(ExoPlayer player) {
            player.seekTo(/* mediaItemIndex= */
            0, /* positionMs= */
            8000);
            mediaItemIndex[0] = player.getCurrentMediaItemIndex();
            isPlayingAd[0] = player.isPlayingAd();
            positionMs[0] = player.getCurrentPosition();
            bufferedPositionMs[0] = player.getBufferedPosition();
            totalBufferedDurationMs[0] = player.getTotalBufferedDuration();
        }
    }).waitForPendingPlayerCommands().executeRunnable(new PlayerRunnable() {

        @Override
        public void run(ExoPlayer player) {
            mediaItemIndex[1] = player.getCurrentMediaItemIndex();
            isPlayingAd[1] = player.isPlayingAd();
            positionMs[1] = player.getCurrentPosition();
            bufferedPositionMs[1] = player.getBufferedPosition();
            totalBufferedDurationMs[1] = player.getTotalBufferedDuration();
        }
    }).stop().build();
    new ExoPlayerTestRunner.Builder(context).setMediaSources(adsMediaSource).setActionSchedule(actionSchedule).build().start().blockUntilActionScheduleFinished(TIMEOUT_MS).blockUntilEnded(TIMEOUT_MS);
    assertThat(mediaItemIndex[0]).isEqualTo(0);
    assertThat(isPlayingAd[0]).isTrue();
    assertThat(positionMs[0]).isEqualTo(0);
    assertThat(bufferedPositionMs[0]).isEqualTo(adDurationMs);
    assertThat(totalBufferedDurationMs[0]).isEqualTo(adDurationMs);
    assertThat(mediaItemIndex[1]).isEqualTo(0);
    assertThat(isPlayingAd[1]).isTrue();
    assertThat(positionMs[1]).isEqualTo(0);
    assertThat(bufferedPositionMs[1]).isEqualTo(adDurationMs);
    assertThat(totalBufferedDurationMs[1]).isEqualTo(adDurationMs);
}
Also used : FakeMediaSource(com.google.android.exoplayer2.testutil.FakeMediaSource) ActionSchedule(com.google.android.exoplayer2.testutil.ActionSchedule) PlayerRunnable(com.google.android.exoplayer2.testutil.ActionSchedule.PlayerRunnable) TestExoPlayerBuilder(com.google.android.exoplayer2.testutil.TestExoPlayerBuilder) NoUidTimeline(com.google.android.exoplayer2.testutil.NoUidTimeline) SinglePeriodTimeline(com.google.android.exoplayer2.source.SinglePeriodTimeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) AdPlaybackState(com.google.android.exoplayer2.source.ads.AdPlaybackState) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) TimelineWindowDefinition(com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition) Test(org.junit.Test)

Example 34 with AdPlaybackState

use of com.google.android.exoplayer2.source.ads.AdPlaybackState in project ExoPlayer by google.

the class ServerSideAdInsertionMediaSourceTest method timeline_containsAdsDefinedInAdPlaybackState.

@Test
public void timeline_containsAdsDefinedInAdPlaybackState() throws Exception {
    FakeTimeline wrappedTimeline = new FakeTimeline(new FakeTimeline.TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    10_000_000, /* defaultPositionUs= */
    3_000_000, /* windowOffsetInFirstPeriodUs= */
    42_000_000L, AdPlaybackState.NONE));
    ServerSideAdInsertionMediaSource mediaSource = new ServerSideAdInsertionMediaSource(new FakeMediaSource(wrappedTimeline), /* adPlaybackStateUpdater= */
    null);
    // Test with one ad group before the window, and the window starting within the second ad group.
    AdPlaybackState adPlaybackState = new AdPlaybackState(/* adsId= */
    new Object(), /* adGroupTimesUs...= */
    15_000_000, 41_500_000, 42_200_000).withIsServerSideInserted(/* adGroupIndex= */
    0, /* isServerSideInserted= */
    true).withIsServerSideInserted(/* adGroupIndex= */
    1, /* isServerSideInserted= */
    true).withIsServerSideInserted(/* adGroupIndex= */
    2, /* isServerSideInserted= */
    true).withAdCount(/* adGroupIndex= */
    0, /* adCount= */
    1).withAdCount(/* adGroupIndex= */
    1, /* adCount= */
    2).withAdCount(/* adGroupIndex= */
    2, /* adCount= */
    1).withAdDurationsUs(/* adGroupIndex= */
    0, /* adDurationsUs...= */
    500_000).withAdDurationsUs(/* adGroupIndex= */
    1, /* adDurationsUs...= */
    300_000, 100_000).withAdDurationsUs(/* adGroupIndex= */
    2, /* adDurationsUs...= */
    400_000).withContentResumeOffsetUs(/* adGroupIndex= */
    0, /* contentResumeOffsetUs= */
    100_000).withContentResumeOffsetUs(/* adGroupIndex= */
    1, /* contentResumeOffsetUs= */
    400_000).withContentResumeOffsetUs(/* adGroupIndex= */
    2, /* contentResumeOffsetUs= */
    200_000);
    AtomicReference<Timeline> timelineReference = new AtomicReference<>();
    mediaSource.setAdPlaybackStates(ImmutableMap.of(new Pair<>(0, 0), adPlaybackState));
    mediaSource.prepareSource((source, timeline) -> timelineReference.set(timeline), /* mediaTransferListener= */
    null, PlayerId.UNSET);
    runMainLooperUntil(() -> timelineReference.get() != null);
    Timeline timeline = timelineReference.get();
    assertThat(timeline.getPeriodCount()).isEqualTo(1);
    Timeline.Period period = timeline.getPeriod(/* periodIndex= */
    0, new Timeline.Period());
    assertThat(period.getAdGroupCount()).isEqualTo(3);
    assertThat(period.getAdCountInAdGroup(/* adGroupIndex= */
    0)).isEqualTo(1);
    assertThat(period.getAdCountInAdGroup(/* adGroupIndex= */
    1)).isEqualTo(2);
    assertThat(period.getAdCountInAdGroup(/* adGroupIndex= */
    2)).isEqualTo(1);
    assertThat(period.getAdGroupTimeUs(/* adGroupIndex= */
    0)).isEqualTo(15_000_000);
    assertThat(period.getAdGroupTimeUs(/* adGroupIndex= */
    1)).isEqualTo(41_500_000);
    assertThat(period.getAdGroupTimeUs(/* adGroupIndex= */
    2)).isEqualTo(42_200_000);
    assertThat(period.getAdDurationUs(/* adGroupIndex= */
    0, /* adIndexInAdGroup= */
    0)).isEqualTo(500_000);
    assertThat(period.getAdDurationUs(/* adGroupIndex= */
    1, /* adIndexInAdGroup= */
    0)).isEqualTo(300_000);
    assertThat(period.getAdDurationUs(/* adGroupIndex= */
    1, /* adIndexInAdGroup= */
    1)).isEqualTo(100_000);
    assertThat(period.getAdDurationUs(/* adGroupIndex= */
    2, /* adIndexInAdGroup= */
    0)).isEqualTo(400_000);
    assertThat(period.getContentResumeOffsetUs(/* adGroupIndex= */
    0)).isEqualTo(100_000);
    assertThat(period.getContentResumeOffsetUs(/* adGroupIndex= */
    1)).isEqualTo(400_000);
    assertThat(period.getContentResumeOffsetUs(/* adGroupIndex= */
    2)).isEqualTo(200_000);
    // windowDurationUs + windowOffsetInFirstPeriodUs - sum(adDurations) + sum(contentResumeOffsets)
    assertThat(period.getDurationUs()).isEqualTo(51_400_000);
    // positionInWindowUs + sum(adDurationsBeforeWindow) - sum(contentResumeOffsetsBeforeWindow)
    assertThat(period.getPositionInWindowUs()).isEqualTo(-41_600_000);
    Timeline.Window window = timeline.getWindow(/* windowIndex= */
    0, new Timeline.Window());
    assertThat(window.positionInFirstPeriodUs).isEqualTo(41_600_000);
    // windowDurationUs - sum(adDurationsInWindow) + sum(applicableContentResumeOffsetUs)
    assertThat(window.durationUs).isEqualTo(9_800_000);
}
Also used : Timeline(com.google.android.exoplayer2.Timeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) FakeMediaSource(com.google.android.exoplayer2.testutil.FakeMediaSource) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) AtomicReference(java.util.concurrent.atomic.AtomicReference) Pair(android.util.Pair) Test(org.junit.Test)

Example 35 with AdPlaybackState

use of com.google.android.exoplayer2.source.ads.AdPlaybackState in project ExoPlayer by google.

the class ServerSideAdInsertionMediaSourceTest method playbackWithNewlyInsertedAds_playsSuccessfulWithoutRendererResets.

@Test
public void playbackWithNewlyInsertedAds_playsSuccessfulWithoutRendererResets() throws Exception {
    Context context = ApplicationProvider.getApplicationContext();
    AtomicReference<Object> periodUid = new AtomicReference<>();
    CapturingRenderersFactory renderersFactory = new CapturingRenderersFactory(context);
    ExoPlayer player = new ExoPlayer.Builder(context, renderersFactory).setClock(new FakeClock(/* isAutoAdvancing= */
    true)).build();
    player.setVideoSurface(new Surface(new SurfaceTexture(/* texName= */
    1)));
    PlaybackOutput playbackOutput = PlaybackOutput.register(player, renderersFactory);
    AdPlaybackState firstAdPlaybackState = addAdGroupToAdPlaybackState(new AdPlaybackState(/* adsId= */
    new Object()), /* fromPositionUs= */
    900_000, /* contentResumeOffsetUs= */
    0, /* adDurationsUs...= */
    100_000);
    AtomicReference<ServerSideAdInsertionMediaSource> mediaSourceRef = new AtomicReference<>();
    mediaSourceRef.set(new ServerSideAdInsertionMediaSource(new DefaultMediaSourceFactory(context).createMediaSource(MediaItem.fromUri(TEST_ASSET)), /* adPlaybackStateUpdater= */
    contentTimeline -> {
        periodUid.set(checkNotNull(contentTimeline.getPeriod(/* periodIndex= */
        0, new Timeline.Period(), /* setIds= */
        true).uid));
        mediaSourceRef.get().setAdPlaybackStates(ImmutableMap.of(periodUid.get(), firstAdPlaybackState));
        return true;
    }));
    AnalyticsListener listener = mock(AnalyticsListener.class);
    player.addAnalyticsListener(listener);
    player.setMediaSource(mediaSourceRef.get());
    player.prepare();
    // Add ad at the current playback position during playback.
    runUntilPlaybackState(player, Player.STATE_READY);
    AdPlaybackState secondAdPlaybackState = addAdGroupToAdPlaybackState(firstAdPlaybackState, /* fromPositionUs= */
    0, /* contentResumeOffsetUs= */
    0, /* adDurationsUs...= */
    500_000);
    mediaSourceRef.get().setAdPlaybackStates(ImmutableMap.of(periodUid.get(), secondAdPlaybackState));
    runUntilPendingCommandsAreFullyHandled(player);
    player.play();
    runUntilPlaybackState(player, Player.STATE_ENDED);
    player.release();
    // Assert all samples have been played.
    DumpFileAsserts.assertOutput(context, playbackOutput, TEST_ASSET_DUMP);
    // Assert playback has been reported with ads: [content][ad0][content][ad1][content]
    // 5*2(audio+video) format changes, 4 discontinuities between parts.
    verify(listener, times(4)).onPositionDiscontinuity(any(), any(), any(), eq(Player.DISCONTINUITY_REASON_AUTO_TRANSITION));
    verify(listener, times(10)).onDownstreamFormatChanged(any(), any());
    // Assert renderers played through without reset (=decoders have been enabled only once).
    verify(listener).onVideoEnabled(any(), any());
    verify(listener).onAudioEnabled(any(), any());
    // Assert playback progression was smooth (=no unexpected delays that cause audio to underrun)
    verify(listener, never()).onAudioUnderrun(any(), anyInt(), anyLong(), anyLong());
}
Also used : Context(android.content.Context) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) AnalyticsListener(com.google.android.exoplayer2.analytics.AnalyticsListener) Context(android.content.Context) TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(com.google.android.exoplayer2.robolectric.TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled) ArgumentMatchers.anyLong(org.mockito.ArgumentMatchers.anyLong) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Pair(android.util.Pair) RunWith(org.junit.runner.RunWith) Player(com.google.android.exoplayer2.Player) DefaultMediaSourceFactory(com.google.android.exoplayer2.source.DefaultMediaSourceFactory) TestPlayerRunHelper.playUntilPosition(com.google.android.exoplayer2.robolectric.TestPlayerRunHelper.playUntilPosition) AndroidJUnit4(androidx.test.ext.junit.runners.AndroidJUnit4) AtomicReference(java.util.concurrent.atomic.AtomicReference) ApplicationProvider(androidx.test.core.app.ApplicationProvider) ExoPlayer(com.google.android.exoplayer2.ExoPlayer) PlayerId(com.google.android.exoplayer2.analytics.PlayerId) ShadowMediaCodecConfig(com.google.android.exoplayer2.robolectric.ShadowMediaCodecConfig) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) RobolectricUtil.runMainLooperUntil(com.google.android.exoplayer2.robolectric.RobolectricUtil.runMainLooperUntil) SurfaceTexture(android.graphics.SurfaceTexture) MediaItem(com.google.android.exoplayer2.MediaItem) TestPlayerRunHelper.runUntilPlaybackState(com.google.android.exoplayer2.robolectric.TestPlayerRunHelper.runUntilPlaybackState) Surface(android.view.Surface) ImmutableMap(com.google.common.collect.ImmutableMap) CapturingRenderersFactory(com.google.android.exoplayer2.testutil.CapturingRenderersFactory) Mockito.times(org.mockito.Mockito.times) Test(org.junit.Test) FakeClock(com.google.android.exoplayer2.testutil.FakeClock) Truth.assertThat(com.google.common.truth.Truth.assertThat) Mockito.verify(org.mockito.Mockito.verify) FakeMediaSource(com.google.android.exoplayer2.testutil.FakeMediaSource) Mockito.never(org.mockito.Mockito.never) Timeline(com.google.android.exoplayer2.Timeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) Rule(org.junit.Rule) DumpFileAsserts(com.google.android.exoplayer2.testutil.DumpFileAsserts) PlaybackOutput(com.google.android.exoplayer2.robolectric.PlaybackOutput) Assert(org.junit.Assert) Assertions.checkNotNull(com.google.android.exoplayer2.util.Assertions.checkNotNull) Mockito.mock(org.mockito.Mockito.mock) AnalyticsListener(com.google.android.exoplayer2.analytics.AnalyticsListener) CapturingRenderersFactory(com.google.android.exoplayer2.testutil.CapturingRenderersFactory) FakeClock(com.google.android.exoplayer2.testutil.FakeClock) AtomicReference(java.util.concurrent.atomic.AtomicReference) ExoPlayer(com.google.android.exoplayer2.ExoPlayer) Surface(android.view.Surface) PlaybackOutput(com.google.android.exoplayer2.robolectric.PlaybackOutput) Timeline(com.google.android.exoplayer2.Timeline) FakeTimeline(com.google.android.exoplayer2.testutil.FakeTimeline) SurfaceTexture(android.graphics.SurfaceTexture) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) DefaultMediaSourceFactory(com.google.android.exoplayer2.source.DefaultMediaSourceFactory) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)89 AdPlaybackState (com.google.android.exoplayer2.source.ads.AdPlaybackState)87 FakeTimeline (com.google.android.exoplayer2.testutil.FakeTimeline)51 ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState (com.google.android.exoplayer2.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState)35 FakeMediaSource (com.google.android.exoplayer2.testutil.FakeMediaSource)32 TimelineWindowDefinition (com.google.android.exoplayer2.testutil.FakeTimeline.TimelineWindowDefinition)27 Pair (android.util.Pair)19 TestExoPlayerBuilder (com.google.android.exoplayer2.testutil.TestExoPlayerBuilder)17 Timeline (com.google.android.exoplayer2.Timeline)15 SinglePeriodTimeline (com.google.android.exoplayer2.source.SinglePeriodTimeline)14 NoUidTimeline (com.google.android.exoplayer2.testutil.NoUidTimeline)14 MediaPeriodId (com.google.android.exoplayer2.source.MediaSource.MediaPeriodId)13 DefaultMediaSourceFactory (com.google.android.exoplayer2.source.DefaultMediaSourceFactory)12 AtomicReference (java.util.concurrent.atomic.AtomicReference)11 Listener (com.google.android.exoplayer2.Player.Listener)10 Context (android.content.Context)9 AnalyticsListener (com.google.android.exoplayer2.analytics.AnalyticsListener)9 ActionSchedule (com.google.android.exoplayer2.testutil.ActionSchedule)8 SurfaceTexture (android.graphics.SurfaceTexture)7 Surface (android.view.Surface)7