Class DefaultLivePlaybackSpeedControl.Builder

    • Constructor Detail

      • Builder

        public Builder()
        Creates a builder.
    • Method Detail

      • setProportionalControlFactor

        @CanIgnoreReturnValue
        public DefaultLivePlaybackSpeedControl.Builder setProportionalControlFactor​(float proportionalControlFactor)
        Sets the proportional control factor used to adjust the playback speed.

        The factor by which playback will be sped up is calculated as 1.0 + proportionalControlFactor x (currentLiveOffsetSec - targetLiveOffsetSec).

        The default is DefaultLivePlaybackSpeedControl.DEFAULT_PROPORTIONAL_CONTROL_FACTOR.

        Parameters:
        proportionalControlFactor - The proportional control factor used to adjust the playback speed.
        Returns:
        This builder, for convenience.
      • setTargetLiveOffsetIncrementOnRebufferMs

        @CanIgnoreReturnValue
        public DefaultLivePlaybackSpeedControl.Builder setTargetLiveOffsetIncrementOnRebufferMs​(long targetLiveOffsetIncrementOnRebufferMs)
        Sets the increment applied to the target live offset each time the player is rebuffering, in milliseconds.
        Parameters:
        targetLiveOffsetIncrementOnRebufferMs - The increment applied to the target live offset when the player is rebuffering, in milliseconds
        Returns:
        This builder, for convenience.
      • setMinPossibleLiveOffsetSmoothingFactor

        @CanIgnoreReturnValue
        public DefaultLivePlaybackSpeedControl.Builder setMinPossibleLiveOffsetSmoothingFactor​(float minPossibleLiveOffsetSmoothingFactor)
        Sets the smoothing factor when smoothing the minimum possible live offset that can be achieved during playback.

        The live playback speed control keeps track of the minimum possible live offset achievable during playback to know whether it can reduce the current target live offset. The minimum possible live offset is defined as currentLiveOffset - bufferedDuration. As the minimum possible live offset is constantly changing, it is smoothed over recent samples by applying exponential smoothing: smoothedMinPossibleOffset = smoothingFactor x smoothedMinPossibleOffset + (1-smoothingFactor) x currentMinPossibleOffset.

        Parameters:
        minPossibleLiveOffsetSmoothingFactor - The smoothing factor. Must be ≥ 0 and < 1.
        Returns:
        This builder, for convenience.