Search in sources :

Example 16 with TestExoPlayerBuilder

use of androidx.media3.test.utils.TestExoPlayerBuilder in project media by androidx.

the class ExoPlayerTest method playShortDurationPeriods.

/**
 * Tests playback of periods with very short duration.
 */
@Test
public void playShortDurationPeriods() throws Exception {
    // TimelineWindowDefinition.DEFAULT_WINDOW_DURATION_US / 100 = 1000 us per period.
    Timeline timeline = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    100, /* id= */
    0));
    FakeRenderer renderer = new FakeRenderer(C.TRACK_TYPE_VIDEO);
    ExoPlayer player = new TestExoPlayerBuilder(context).setRenderers(renderer).build();
    Player.Listener mockPlayerListener = mock(Player.Listener.class);
    player.addListener(mockPlayerListener);
    player.setMediaSource(new FakeMediaSource(timeline, ExoPlayerTestRunner.VIDEO_FORMAT));
    player.prepare();
    player.play();
    runUntilPlaybackState(player, Player.STATE_ENDED);
    InOrder inOrder = inOrder(mockPlayerListener);
    inOrder.verify(mockPlayerListener).onTimelineChanged(argThat(noUid(placeholderTimeline)), eq(Player.TIMELINE_CHANGE_REASON_PLAYLIST_CHANGED));
    inOrder.verify(mockPlayerListener).onTimelineChanged(argThat(noUid(timeline)), eq(Player.TIMELINE_CHANGE_REASON_SOURCE_UPDATE));
    inOrder.verify(mockPlayerListener, times(99)).onPositionDiscontinuity(any(), any(), eq(Player.DISCONTINUITY_REASON_AUTO_TRANSITION));
    assertThat(renderer.getFormatsRead()).hasSize(100);
    assertThat(renderer.sampleBufferReadCount).isEqualTo(100);
    assertThat(renderer.isEnded).isTrue();
}
Also used : FakeRenderer(androidx.media3.test.utils.FakeRenderer) Listener(androidx.media3.common.Player.Listener) Timeline(androidx.media3.common.Timeline) NoUidTimeline(androidx.media3.test.utils.NoUidTimeline) FakeTimeline(androidx.media3.test.utils.FakeTimeline) SinglePeriodTimeline(androidx.media3.exoplayer.source.SinglePeriodTimeline) Player(androidx.media3.common.Player) InOrder(org.mockito.InOrder) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) FakeTimeline(androidx.media3.test.utils.FakeTimeline) TimelineWindowDefinition(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) Test(org.junit.Test)

Example 17 with TestExoPlayerBuilder

use of androidx.media3.test.utils.TestExoPlayerBuilder in project media by androidx.

the class ExoPlayerTest method seekToNext_liveWindowWithoutNextWindow_seeksToLiveEdge.

@Test
public void seekToNext_liveWindowWithoutNextWindow_seeksToLiveEdge() throws Exception {
    ExoPlayer player = new TestExoPlayerBuilder(context).build();
    Timeline timeline = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    1_000_000, /* defaultPositionUs= */
    500_000, TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US, AdPlaybackState.NONE));
    MediaSource mediaSource = new FakeMediaSource(timeline);
    player.setMediaSource(mediaSource);
    player.prepare();
    TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY);
    player.seekTo(/* positionMs = */
    0);
    player.seekToNext();
    assertThat(player.getCurrentMediaItemIndex()).isEqualTo(0);
    assertThat(player.getCurrentPosition()).isEqualTo(500);
    player.release();
}
Also used : Timeline(androidx.media3.common.Timeline) NoUidTimeline(androidx.media3.test.utils.NoUidTimeline) FakeTimeline(androidx.media3.test.utils.FakeTimeline) SinglePeriodTimeline(androidx.media3.exoplayer.source.SinglePeriodTimeline) CompositeMediaSource(androidx.media3.exoplayer.source.CompositeMediaSource) ClippingMediaSource(androidx.media3.exoplayer.source.ClippingMediaSource) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) MaskingMediaSource(androidx.media3.exoplayer.source.MaskingMediaSource) ServerSideAdInsertionMediaSource(androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource) FakeAdaptiveMediaSource(androidx.media3.test.utils.FakeAdaptiveMediaSource) ConcatenatingMediaSource(androidx.media3.exoplayer.source.ConcatenatingMediaSource) MediaSource(androidx.media3.exoplayer.source.MediaSource) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) FakeTimeline(androidx.media3.test.utils.FakeTimeline) TimelineWindowDefinition(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) Test(org.junit.Test)

Example 18 with TestExoPlayerBuilder

use of androidx.media3.test.utils.TestExoPlayerBuilder in project media by androidx.

the class ExoPlayerTest method targetLiveOffsetInMedia_afterSeekToSpecificPositionInOtherStream_adjustsLiveOffsetToSeekPosition.

@Test
public void targetLiveOffsetInMedia_afterSeekToSpecificPositionInOtherStream_adjustsLiveOffsetToSeekPosition() throws Exception {
    long windowStartUnixTimeMs = 987_654_321_000L;
    long nowUnixTimeMs = windowStartUnixTimeMs + 20_000;
    ExoPlayer player = new TestExoPlayerBuilder(context).setClock(new FakeClock(/* initialTimeMs= */
    nowUnixTimeMs, /* isAutoAdvancing= */
    true)).build();
    Timeline liveTimeline1 = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    1000 * C.MICROS_PER_SECOND, /* defaultPositionUs= */
    8 * C.MICROS_PER_SECOND, /* windowOffsetInFirstPeriodUs= */
    Util.msToUs(windowStartUnixTimeMs), ImmutableList.of(AdPlaybackState.NONE), new MediaItem.Builder().setUri(Uri.EMPTY).setLiveConfiguration(new MediaItem.LiveConfiguration.Builder().setTargetOffsetMs(9_000).build()).build()));
    Timeline liveTimeline2 = new FakeTimeline(new TimelineWindowDefinition(/* periodCount= */
    1, /* id= */
    0, /* isSeekable= */
    true, /* isDynamic= */
    true, /* isLive= */
    true, /* isPlaceholder= */
    false, /* durationUs= */
    1000 * C.MICROS_PER_SECOND, /* defaultPositionUs= */
    8 * C.MICROS_PER_SECOND, /* windowOffsetInFirstPeriodUs= */
    Util.msToUs(windowStartUnixTimeMs), ImmutableList.of(AdPlaybackState.NONE), new MediaItem.Builder().setUri(Uri.EMPTY).setLiveConfiguration(new MediaItem.LiveConfiguration.Builder().setTargetOffsetMs(4_000).build()).build()));
    player.pause();
    player.addMediaSource(new FakeMediaSource(liveTimeline1));
    player.addMediaSource(new FakeMediaSource(liveTimeline2));
    // Ensure we override the target live offset to a seek position in the first live stream.
    player.seekTo(10_000);
    player.prepare();
    TestPlayerRunHelper.runUntilPlaybackState(player, Player.STATE_READY);
    // Seek to specific position in second stream (at 2 seconds live offset).
    player.seekTo(/* mediaItemIndex= */
    1, /* positionMs= */
    18_000);
    // Play until close to the end of the available live window.
    TestPlayerRunHelper.playUntilPosition(player, /* mediaItemIndex= */
    1, /* positionMs= */
    999_000);
    long liveOffsetAtEnd = player.getCurrentLiveOffset();
    player.release();
    // Assert that player adjusted live offset to the seek.
    assertThat(liveOffsetAtEnd).isIn(Range.closed(1_900L, 2_100L));
}
Also used : Timeline(androidx.media3.common.Timeline) NoUidTimeline(androidx.media3.test.utils.NoUidTimeline) FakeTimeline(androidx.media3.test.utils.FakeTimeline) SinglePeriodTimeline(androidx.media3.exoplayer.source.SinglePeriodTimeline) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) FakeClock(androidx.media3.test.utils.FakeClock) FakeTimeline(androidx.media3.test.utils.FakeTimeline) MediaItem(androidx.media3.common.MediaItem) TestPlayerRunHelper.playUntilStartOfMediaItem(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.playUntilStartOfMediaItem) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) TimelineWindowDefinition(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) Test(org.junit.Test)

Example 19 with TestExoPlayerBuilder

use of androidx.media3.test.utils.TestExoPlayerBuilder in project media by androidx.

the class ExoPlayerTest method addMediaSource_atTheEnd_notifiesAvailableCommandsChanged.

@Test
public void addMediaSource_atTheEnd_notifiesAvailableCommandsChanged() {
    Player.Commands defaultCommands = createWithDefaultCommands();
    Player.Commands commandsWithSeekToNextWindow = createWithDefaultCommands(COMMAND_SEEK_TO_NEXT_MEDIA_ITEM, COMMAND_SEEK_TO_NEXT);
    Player.Listener mockListener = mock(Player.Listener.class);
    ExoPlayer player = new TestExoPlayerBuilder(context).build();
    player.addListener(mockListener);
    player.addMediaSource(new FakeMediaSource());
    verify(mockListener).onAvailableCommandsChanged(defaultCommands);
    // Check that there were no other calls to onAvailableCommandsChanged.
    verify(mockListener).onAvailableCommandsChanged(any());
    player.addMediaSource(new FakeMediaSource());
    verify(mockListener).onAvailableCommandsChanged(commandsWithSeekToNextWindow);
    verify(mockListener, times(2)).onAvailableCommandsChanged(any());
    player.addMediaSource(new FakeMediaSource());
    verify(mockListener, times(2)).onAvailableCommandsChanged(any());
}
Also used : Listener(androidx.media3.common.Player.Listener) Player(androidx.media3.common.Player) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) Test(org.junit.Test)

Example 20 with TestExoPlayerBuilder

use of androidx.media3.test.utils.TestExoPlayerBuilder in project media by androidx.

the class ExoPlayerTest method seekTo_toPlayedSAIMidRolls_requestedContentPositionNotPropagatedIntoAds.

@Test
public void seekTo_toPlayedSAIMidRolls_requestedContentPositionNotPropagatedIntoAds() throws Exception {
    ArgumentCaptor<PositionInfo> oldPositionArgumentCaptor = ArgumentCaptor.forClass(PositionInfo.class);
    ArgumentCaptor<PositionInfo> newPositionArgumentCaptor = ArgumentCaptor.forClass(PositionInfo.class);
    ArgumentCaptor<Integer> reasonArgumentCaptor = ArgumentCaptor.forClass(Integer.class);
    FakeTimeline adTimeline = FakeTimeline.createMultiPeriodAdTimeline("windowId", /* numberOfPlayedAds= */
    2, /* isAdPeriodFlags...= */
    false, true, true, false);
    Listener listener = mock(Listener.class);
    ExoPlayer player = new TestExoPlayerBuilder(context).build();
    player.addListener(listener);
    AtomicReference<ServerSideAdInsertionMediaSource> sourceReference = new AtomicReference<>();
    sourceReference.set(new ServerSideAdInsertionMediaSource(new FakeMediaSource(adTimeline), contentTimeline -> {
        sourceReference.get().setAdPlaybackStates(adTimeline.getAdPlaybackStates(/* windowIndex= */
        0));
        return true;
    }));
    player.setMediaSource(sourceReference.get());
    player.pause();
    player.prepare();
    runUntilPlaybackState(player, Player.STATE_READY);
    player.seekTo(2500);
    player.play();
    runUntilPlaybackState(player, Player.STATE_ENDED);
    player.release();
    verify(listener, times(1)).onPositionDiscontinuity(oldPositionArgumentCaptor.capture(), newPositionArgumentCaptor.capture(), reasonArgumentCaptor.capture());
    assertThat(reasonArgumentCaptor.getAllValues()).containsExactly(1).inOrder();
    List<PositionInfo> oldPositions = oldPositionArgumentCaptor.getAllValues();
    List<PositionInfo> newPositions = newPositionArgumentCaptor.getAllValues();
    // seek discontinuity
    assertThat(oldPositions.get(0).periodIndex).isEqualTo(0);
    assertThat(oldPositions.get(0).adGroupIndex).isEqualTo(-1);
    // TODO(bachinger): Incorrect masking. Skipped played prerolls not taken into account by masking
    assertThat(newPositions.get(0).periodIndex).isEqualTo(1);
    assertThat(newPositions.get(0).adGroupIndex).isEqualTo(-1);
}
Also used : IllegalSeekPositionException(androidx.media3.common.IllegalSeekPositionException) COMMAND_ADJUST_DEVICE_VOLUME(androidx.media3.common.Player.COMMAND_ADJUST_DEVICE_VOLUME) Arrays(java.util.Arrays) ArgumentMatchers(org.mockito.ArgumentMatchers) ArgumentMatchers.eq(org.mockito.ArgumentMatchers.eq) Uri(android.net.Uri) COMMAND_SEEK_TO_NEXT_MEDIA_ITEM(androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT_MEDIA_ITEM) COMMAND_GET_CURRENT_MEDIA_ITEM(androidx.media3.common.Player.COMMAND_GET_CURRENT_MEDIA_ITEM) Allocator(androidx.media3.exoplayer.upstream.Allocator) COMMAND_GET_MEDIA_ITEMS_METADATA(androidx.media3.common.Player.COMMAND_GET_MEDIA_ITEMS_METADATA) CompositeMediaSource(androidx.media3.exoplayer.source.CompositeMediaSource) DefaultTrackSelector(androidx.media3.exoplayer.trackselection.DefaultTrackSelector) COMMAND_SEEK_TO_MEDIA_ITEM(androidx.media3.common.Player.COMMAND_SEEK_TO_MEDIA_ITEM) COMMAND_GET_TIMELINE(androidx.media3.common.Player.COMMAND_GET_TIMELINE) ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState(androidx.media3.exoplayer.source.ads.ServerSideAdInsertionUtil.addAdGroupToAdPlaybackState) Looper(android.os.Looper) COMMAND_SET_REPEAT_MODE(androidx.media3.common.Player.COMMAND_SET_REPEAT_MODE) ClippingMediaSource(androidx.media3.exoplayer.source.ClippingMediaSource) Surface(android.view.Surface) Mockito.atLeastOnce(org.mockito.Mockito.atLeastOnce) Range(com.google.common.collect.Range) FakeSampleStream(androidx.media3.test.utils.FakeSampleStream) TextInformationFrame(androidx.media3.extractor.metadata.id3.TextInformationFrame) TestPlayerRunHelper(androidx.media3.test.utils.robolectric.TestPlayerRunHelper) CountDownLatch(java.util.concurrent.CountDownLatch) Nullable(androidx.annotation.Nullable) Allocation(androidx.media3.exoplayer.upstream.Allocation) ArgumentMatchers.anyFloat(org.mockito.ArgumentMatchers.anyFloat) Timeline(androidx.media3.common.Timeline) BinaryFrame(androidx.media3.extractor.metadata.id3.BinaryFrame) FakeRenderer(androidx.media3.test.utils.FakeRenderer) NoUidTimeline(androidx.media3.test.utils.NoUidTimeline) FakeClock(androidx.media3.test.utils.FakeClock) Mockito.mock(org.mockito.Mockito.mock) AnalyticsListener(androidx.media3.exoplayer.analytics.AnalyticsListener) ExoPlayerTestRunner(androidx.media3.test.utils.ExoPlayerTestRunner) Iterables(com.google.common.collect.Iterables) AdPlaybackState(androidx.media3.common.AdPlaybackState) Loader(androidx.media3.exoplayer.upstream.Loader) COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM(androidx.media3.common.Player.COMMAND_SEEK_IN_CURRENT_MEDIA_ITEM) TestPlayerRunHelper.runUntilPositionDiscontinuity(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilPositionDiscontinuity) RunWith(org.junit.runner.RunWith) Config(org.robolectric.annotation.Config) COMMAND_PLAY_PAUSE(androidx.media3.common.Player.COMMAND_PLAY_PAUSE) ArgumentMatchers.anyBoolean(org.mockito.ArgumentMatchers.anyBoolean) ArrayList(java.util.ArrayList) FakeTrackSelection(androidx.media3.test.utils.FakeTrackSelection) Assert.assertArrayEquals(org.junit.Assert.assertArrayEquals) Assertions(androidx.media3.common.util.Assertions) DiscontinuityReason(androidx.media3.common.Player.DiscontinuityReason) COMMAND_SEEK_TO_DEFAULT_POSITION(androidx.media3.common.Player.COMMAND_SEEK_TO_DEFAULT_POSITION) Before(org.junit.Before) TransferListener(androidx.media3.datasource.TransferListener) MediaSourceEventListener(androidx.media3.exoplayer.source.MediaSourceEventListener) Player(androidx.media3.common.Player) ShadowLooper(org.robolectric.shadows.ShadowLooper) COMMAND_SET_DEVICE_VOLUME(androidx.media3.common.Player.COMMAND_SET_DEVICE_VOLUME) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) TestPlayerRunHelper.runUntilSleepingForOffload(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilSleepingForOffload) Mockito.times(org.mockito.Mockito.times) IOException(java.io.IOException) Test(org.junit.Test) Listener(androidx.media3.common.Player.Listener) TestUtil.assertTimelinesSame(androidx.media3.test.utils.TestUtil.assertTimelinesSame) FakeShuffleOrder(androidx.media3.test.utils.FakeShuffleOrder) FakeMediaPeriod(androidx.media3.test.utils.FakeMediaPeriod) AtomicLong(java.util.concurrent.atomic.AtomicLong) Mockito.never(org.mockito.Mockito.never) COMMAND_GET_AUDIO_ATTRIBUTES(androidx.media3.common.Player.COMMAND_GET_AUDIO_ATTRIBUTES) FakeVideoRenderer(androidx.media3.test.utils.FakeVideoRenderer) COMMAND_GET_DEVICE_VOLUME(androidx.media3.common.Player.COMMAND_GET_DEVICE_VOLUME) MediaPeriodId(androidx.media3.exoplayer.source.MediaSource.MediaPeriodId) Mockito.reset(org.mockito.Mockito.reset) FakeMediaSourceFactory(androidx.media3.test.utils.FakeMediaSourceFactory) COMMAND_SET_VIDEO_SURFACE(androidx.media3.common.Player.COMMAND_SET_VIDEO_SURFACE) COMMAND_SEEK_TO_PREVIOUS(androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS) PlayerRunnable(androidx.media3.test.utils.ActionSchedule.PlayerRunnable) COMMAND_CHANGE_MEDIA_ITEMS(androidx.media3.common.Player.COMMAND_CHANGE_MEDIA_ITEMS) ArgumentMatchers.argThat(org.mockito.ArgumentMatchers.argThat) Action(androidx.media3.test.utils.Action) Random(java.util.Random) MaskingMediaSource(androidx.media3.exoplayer.source.MaskingMediaSource) COMMAND_STOP(androidx.media3.common.Player.COMMAND_STOP) AndroidJUnit4(androidx.test.ext.junit.runners.AndroidJUnit4) AudioAttributes(androidx.media3.common.AudioAttributes) ApplicationProvider(androidx.test.core.app.ApplicationProvider) DrmSessionManager(androidx.media3.exoplayer.drm.DrmSessionManager) FakeTrackSelector(androidx.media3.test.utils.FakeTrackSelector) ArgumentMatcher(org.mockito.ArgumentMatcher) END_OF_STREAM_ITEM(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.END_OF_STREAM_ITEM) COMMAND_SET_SPEED_AND_PITCH(androidx.media3.common.Player.COMMAND_SET_SPEED_AND_PITCH) FakeAdaptiveDataSet(androidx.media3.test.utils.FakeAdaptiveDataSet) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) FakeMediaClockRenderer(androidx.media3.test.utils.FakeMediaClockRenderer) Mockito.atLeast(org.mockito.Mockito.atLeast) Assert.fail(org.junit.Assert.fail) FakeSampleStreamItem(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem) MediaItem(androidx.media3.common.MediaItem) TestPlayerRunHelper.runUntilTimelineChanged(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilTimelineChanged) COMMAND_GET_TRACK_INFOS(androidx.media3.common.Player.COMMAND_GET_TRACK_INFOS) ServerSideAdInsertionMediaSource(androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource) FakeChunkSource(androidx.media3.test.utils.FakeChunkSource) TestPlayerRunHelper.playUntilPosition(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.playUntilPosition) PlaybackException(androidx.media3.common.PlaybackException) TrackGroupArray(androidx.media3.common.TrackGroupArray) Util(androidx.media3.common.util.Util) Collectors(java.util.stream.Collectors) Format(androidx.media3.common.Format) COMMAND_SET_TRACK_SELECTION_PARAMETERS(androidx.media3.common.Player.COMMAND_SET_TRACK_SELECTION_PARAMETERS) COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM(androidx.media3.common.Player.COMMAND_SEEK_TO_PREVIOUS_MEDIA_ITEM) PlaybackParameters(androidx.media3.common.PlaybackParameters) List(java.util.List) FakeAdaptiveMediaSource(androidx.media3.test.utils.FakeAdaptiveMediaSource) TrackSelectionArray(androidx.media3.common.TrackSelectionArray) Mockito.inOrder(org.mockito.Mockito.inOrder) ConcatenatingMediaSource(androidx.media3.exoplayer.source.ConcatenatingMediaSource) AdditionalMatchers.not(org.mockito.AdditionalMatchers.not) ArgumentMatchers.any(org.mockito.ArgumentMatchers.any) TrackGroup(androidx.media3.common.TrackGroup) Context(android.content.Context) DEFAULT_WINDOW_DURATION_US(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_DURATION_US) COMMAND_SET_SHUFFLE_MODE(androidx.media3.common.Player.COMMAND_SET_SHUFFLE_MODE) COMMAND_GET_TEXT(androidx.media3.common.Player.COMMAND_GET_TEXT) Assert.assertThrows(org.junit.Assert.assertThrows) MediaMetadata(androidx.media3.common.MediaMetadata) Metadata(androidx.media3.common.Metadata) TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilPendingCommandsAreFullyHandled) TracksInfo(androidx.media3.common.TracksInfo) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) TestPlayerRunHelper.playUntilStartOfMediaItem(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.playUntilStartOfMediaItem) Intent(android.content.Intent) COMMAND_PREPARE(androidx.media3.common.Player.COMMAND_PREPARE) FakeTimeline(androidx.media3.test.utils.FakeTimeline) AtomicReference(java.util.concurrent.atomic.AtomicReference) Shadows.shadowOf(org.robolectric.Shadows.shadowOf) ActionSchedule(androidx.media3.test.utils.ActionSchedule) AudioManager(android.media.AudioManager) FakeDataSource(androidx.media3.test.utils.FakeDataSource) HashSet(java.util.HashSet) COMMAND_SEEK_FORWARD(androidx.media3.common.Player.COMMAND_SEEK_FORWARD) COMMAND_SET_VOLUME(androidx.media3.common.Player.COMMAND_SET_VOLUME) TimelineWindowDefinition(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition) PlayerTarget(androidx.media3.test.utils.ActionSchedule.PlayerTarget) ArgumentCaptor(org.mockito.ArgumentCaptor) ShadowAudioManager(org.robolectric.shadows.ShadowAudioManager) SinglePeriodTimeline(androidx.media3.exoplayer.source.SinglePeriodTimeline) ImmutableList(com.google.common.collect.ImmutableList) DrmSessionEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener) Window(androidx.media3.common.Timeline.Window) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) ArgumentMatchers.anyInt(org.mockito.ArgumentMatchers.anyInt) RobolectricUtil.runMainLooperUntil(androidx.media3.test.utils.robolectric.RobolectricUtil.runMainLooperUntil) SurfaceTexture(android.graphics.SurfaceTexture) DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US(androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition.DEFAULT_WINDOW_OFFSET_IN_FIRST_PERIOD_US) MediaSource(androidx.media3.exoplayer.source.MediaSource) InOrder(org.mockito.InOrder) COMMAND_SEEK_BACK(androidx.media3.common.Player.COMMAND_SEEK_BACK) MimeTypes(androidx.media3.common.MimeTypes) COMMAND_SEEK_TO_NEXT(androidx.media3.common.Player.COMMAND_SEEK_TO_NEXT) Clock(androidx.media3.common.util.Clock) Truth.assertThat(com.google.common.truth.Truth.assertThat) COMMAND_SET_MEDIA_ITEMS_METADATA(androidx.media3.common.Player.COMMAND_SET_MEDIA_ITEMS_METADATA) TestPlayerRunHelper.runUntilReceiveOffloadSchedulingEnabledNewState(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilReceiveOffloadSchedulingEnabledNewState) Mockito.verify(org.mockito.Mockito.verify) COMMAND_GET_VOLUME(androidx.media3.common.Player.COMMAND_GET_VOLUME) C(androidx.media3.common.C) Mockito(org.mockito.Mockito) PositionInfo(androidx.media3.common.Player.PositionInfo) FakeSampleStreamItem.oneByteSample(androidx.media3.test.utils.FakeSampleStream.FakeSampleStreamItem.oneByteSample) STATE_ENDED(androidx.media3.common.Player.STATE_ENDED) MediaPeriod(androidx.media3.exoplayer.source.MediaPeriod) Collections(java.util.Collections) TestPlayerRunHelper.runUntilPlaybackState(androidx.media3.test.utils.robolectric.TestPlayerRunHelper.runUntilPlaybackState) AnalyticsListener(androidx.media3.exoplayer.analytics.AnalyticsListener) TransferListener(androidx.media3.datasource.TransferListener) MediaSourceEventListener(androidx.media3.exoplayer.source.MediaSourceEventListener) Listener(androidx.media3.common.Player.Listener) DrmSessionEventListener(androidx.media3.exoplayer.drm.DrmSessionEventListener) FakeMediaSource(androidx.media3.test.utils.FakeMediaSource) AtomicReference(java.util.concurrent.atomic.AtomicReference) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) ServerSideAdInsertionMediaSource(androidx.media3.exoplayer.source.ads.ServerSideAdInsertionMediaSource) FakeTimeline(androidx.media3.test.utils.FakeTimeline) PositionInfo(androidx.media3.common.Player.PositionInfo) TestExoPlayerBuilder(androidx.media3.test.utils.TestExoPlayerBuilder) Test(org.junit.Test)

Aggregations

TestExoPlayerBuilder (androidx.media3.test.utils.TestExoPlayerBuilder)115 Test (org.junit.Test)115 FakeMediaSource (androidx.media3.test.utils.FakeMediaSource)101 Listener (androidx.media3.common.Player.Listener)74 FakeTimeline (androidx.media3.test.utils.FakeTimeline)74 Player (androidx.media3.common.Player)65 Timeline (androidx.media3.common.Timeline)62 SinglePeriodTimeline (androidx.media3.exoplayer.source.SinglePeriodTimeline)61 NoUidTimeline (androidx.media3.test.utils.NoUidTimeline)61 TimelineWindowDefinition (androidx.media3.test.utils.FakeTimeline.TimelineWindowDefinition)55 MediaItem (androidx.media3.common.MediaItem)38 TestPlayerRunHelper.playUntilStartOfMediaItem (androidx.media3.test.utils.robolectric.TestPlayerRunHelper.playUntilStartOfMediaItem)37 PositionInfo (androidx.media3.common.Player.PositionInfo)31 ConcatenatingMediaSource (androidx.media3.exoplayer.source.ConcatenatingMediaSource)30 InOrder (org.mockito.InOrder)30 TransferListener (androidx.media3.datasource.TransferListener)29 MediaSource (androidx.media3.exoplayer.source.MediaSource)28 FakeRenderer (androidx.media3.test.utils.FakeRenderer)28 ArrayList (java.util.ArrayList)28 AnalyticsListener (androidx.media3.exoplayer.analytics.AnalyticsListener)27