Interface LivePlaybackSpeedControl

  • All Known Implementing Classes:

    public interface LivePlaybackSpeedControl
    Deprecated. is deprecated. Please migrate to androidx.media3 (which contains the same ExoPlayer code). See the migration guide for more details, including a script to help with the migration.
    Controls the playback speed while playing live content in order to maintain a steady target live offset.
    • Method Detail

      • notifyRebuffer

        void notifyRebuffer()
        Notifies the live playback speed control that a rebuffer occurred.

        A rebuffer is defined to be caused by buffer depletion rather than a user action. Hence this method is not called during initial buffering or when buffering as a result of a seek operation.

      • getAdjustedPlaybackSpeed

        float getAdjustedPlaybackSpeed​(long liveOffsetUs,
                                       long bufferedDurationUs)
        Returns the adjusted playback speed in order get closer towards the target live offset.
        liveOffsetUs - The current live offset, in microseconds.
        bufferedDurationUs - The duration of media that's currently buffered, in microseconds.
        The adjusted factor by which playback should be sped up.
      • getTargetLiveOffsetUs

        long getTargetLiveOffsetUs()
        Returns the current target live offset, in microseconds, or C.TIME_UNSET if no target live offset is defined for the current media.