Class TestExoPlayerBuilder


  • public class TestExoPlayerBuilder
    extends Object
    A builder of ExoPlayer instances for testing.
    • Constructor Detail

      • TestExoPlayerBuilder

        public TestExoPlayerBuilder​(Context context)
    • Method Detail

      • setUseLazyPreparation

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setUseLazyPreparation​(boolean useLazyPreparation)
        Sets whether to use lazy preparation.
        Parameters:
        useLazyPreparation - Whether to use lazy preparation.
        Returns:
        This builder.
      • getUseLazyPreparation

        public boolean getUseLazyPreparation()
        Returns whether the player will use lazy preparation.
      • getTrackSelector

        public DefaultTrackSelector getTrackSelector()
        Returns the track selector used by the player.
      • getLoadControl

        public LoadControl getLoadControl()
        Returns the LoadControl that will be used by the player.
      • getBandwidthMeter

        public BandwidthMeter getBandwidthMeter()
        Returns the bandwidth meter used by the player.
      • setClock

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setClock​(Clock clock)
        Sets the Clock to be used by the player. The default value is an auto-advancing FakeClock.
        Parameters:
        clock - A Clock to be used by the player.
        Returns:
        This builder.
      • getClock

        public Clock getClock()
        Returns the clock used by the player.
      • setLooper

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setLooper​(Looper looper)
        Sets the Looper to be used by the player.
        Parameters:
        looper - The Looper to be used by the player.
        Returns:
        This builder.
      • getLooper

        @Nullable
        public Looper getLooper()
        Returns the Looper that will be used by the player, or null if no Looper has been set yet and no default is available.
      • setSeekBackIncrementMs

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setSeekBackIncrementMs​(long seekBackIncrementMs)
        Sets the seek back increment to be used by the player.
        Parameters:
        seekBackIncrementMs - The seek back increment to be used by the player.
        Returns:
        This builder.
      • getSeekBackIncrementMs

        public long getSeekBackIncrementMs()
        Returns the seek back increment used by the player.
      • setSeekForwardIncrementMs

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setSeekForwardIncrementMs​(long seekForwardIncrementMs)
        Sets the seek forward increment to be used by the player.
        Parameters:
        seekForwardIncrementMs - The seek forward increment to be used by the player.
        Returns:
        This builder.
      • setDeviceVolumeControlEnabled

        @CanIgnoreReturnValue
        public TestExoPlayerBuilder setDeviceVolumeControlEnabled​(boolean deviceVolumeControlEnabled)
        Sets the variable controlling player's ability to get/set device volume.
        Parameters:
        deviceVolumeControlEnabled - Whether the player can get/set device volume.
        Returns:
        This builder.
      • getSeekForwardIncrementMs

        public long getSeekForwardIncrementMs()
        Returns the seek forward increment used by the player.
      • build

        public ExoPlayer build()
        Builds an ExoPlayer using the provided values or their defaults.