PlaybackProperties

data class PlaybackProperties(val preferredInitialBufferDurationMs: Int = DEFAULT_BUFFER_FOR_PLAYBACK_MS, val preferredMinBufferDurationMs: Int = DEFAULT_MIN_BUFFER_MS, val preferredMaxBufferDurationMs: Int = DEFAULT_MAX_BUFFER_MS, val preferredConnectTimeoutMs: Int = DEFAULT_CONNECT_TIMEOUT_MS, val preferredReadTimeoutMs: Int = DEFAULT_READ_TIMEOUT_MS, val preferredBufferDurationAfterRebufferMs: Int = DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS, val preferredMinLoadableRetryCount: Int = DEFAULT_MIN_LOADABLE_RETRY_COUNT, val autoPlayOnLoad: Boolean = DEFAULT_BOOL_VAL, var initialStartTimeMs: Long = UNKNOWN_LONG_VAL, val monitorLiveStream: Boolean = DEFAULT_BOOL_VAL, val liveStreamMonitorConfiguration: LiveStreamMonitorConfiguration = LiveStreamMonitorConfiguration(), val asyncCodecProcessing: Boolean? = null, val tunnelingMode: Boolean = DEFAULT_BOOL_VAL, val monitorVFPO: Boolean = DEFAULT_BOOL_VAL, val vfpoMonitoringRange: IntRange = IntRange(DEFAULT_MIN_VFPO, DEFAULT_MAX_VFPO), val mediaSessionPlaybackActions: LongArray = SUPPORTED_PLAYBACK_ACTIONS, val preferredInitialNetworkBandwidth: Long? = null, val preferredMinDurationForQualityIncreaseMs: Int? = null, val preferredMaxDurationForQualityDecreaseMs: Int? = null, val preferredMinDurationToRetainAfterDiscardMs: Int? = null, val preferredBandwidthFraction: Float? = null, val preferredMaxPlaybackRecoveryRetryCount: Int = DEFAULT_MAX_PLAYBACK_RECOVERY_RETRY_COUNT, val preferredTargetLiveOffsetMs: Long? = null, val preferredMinPlaybackSpeed: Float? = null, val preferredMaxPlaybackSpeed: Float? = null, val preferredBufferedFractionToLiveEdgeForQualityIncrease: Float? = null, val preferredMinLiveStartPosition: Long? = null, val preferredSeekForwardIncrementMs: Long? = DEFAULT_SEEK_FORWARD_INCREMENT_MS, val preferredSeekBackIncrementMs: Long? = DEFAULT_SEEK_BACK_INCREMENT_MS, val preferredBufferTimeoutMs: Long? = null, val remoteStopLivePlaybackOnPause: Boolean? = null, val handleAudioFocus: Boolean = true, val preferredFallbackMinPlaybackSpeed: Float = DEFAULT_FALLBACK_MIN_PLAYBACK_SPEED, val preferredFallbackMaxPlaybackSpeed: Float = DEFAULT_FALLBACK_MAX_PLAYBACK_SPEED, val preferredTargetLiveOffsetIncrementOnRebufferMs: Long = DEFAULT_TARGET_LIVE_OFFSET_INCREMENT_ON_REBUFFER_MS, val preferredMaxBitrate: Int? = null, val preferredMinBitrate: Int? = null, val preferredBackBufferDurationMs: Int = DEFAULT_BACK_BUFFER_DURATION_MS, val preferredRetainBackBufferFromKeyframe: Boolean = DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME)

Encapsulates all the configurable properties applicable for playback. All the properties have recommended default values that are suitable for most cases.

Constructors

Link copied to clipboard
constructor(preferredInitialBufferDurationMs: Int = DEFAULT_BUFFER_FOR_PLAYBACK_MS, preferredMinBufferDurationMs: Int = DEFAULT_MIN_BUFFER_MS, preferredMaxBufferDurationMs: Int = DEFAULT_MAX_BUFFER_MS, preferredConnectTimeoutMs: Int = DEFAULT_CONNECT_TIMEOUT_MS, preferredReadTimeoutMs: Int = DEFAULT_READ_TIMEOUT_MS, preferredBufferDurationAfterRebufferMs: Int = DEFAULT_BUFFER_FOR_PLAYBACK_AFTER_REBUFFER_MS, preferredMinLoadableRetryCount: Int = DEFAULT_MIN_LOADABLE_RETRY_COUNT, autoPlayOnLoad: Boolean = DEFAULT_BOOL_VAL, initialStartTimeMs: Long = UNKNOWN_LONG_VAL, monitorLiveStream: Boolean = DEFAULT_BOOL_VAL, liveStreamMonitorConfiguration: LiveStreamMonitorConfiguration = LiveStreamMonitorConfiguration(), asyncCodecProcessing: Boolean? = null, tunnelingMode: Boolean = DEFAULT_BOOL_VAL, monitorVFPO: Boolean = DEFAULT_BOOL_VAL, vfpoMonitoringRange: IntRange = IntRange(DEFAULT_MIN_VFPO, DEFAULT_MAX_VFPO), mediaSessionPlaybackActions: LongArray = SUPPORTED_PLAYBACK_ACTIONS, preferredInitialNetworkBandwidth: Long? = null, preferredMinDurationForQualityIncreaseMs: Int? = null, preferredMaxDurationForQualityDecreaseMs: Int? = null, preferredMinDurationToRetainAfterDiscardMs: Int? = null, preferredBandwidthFraction: Float? = null, preferredMaxPlaybackRecoveryRetryCount: Int = DEFAULT_MAX_PLAYBACK_RECOVERY_RETRY_COUNT, preferredTargetLiveOffsetMs: Long? = null, preferredMinPlaybackSpeed: Float? = null, preferredMaxPlaybackSpeed: Float? = null, preferredBufferedFractionToLiveEdgeForQualityIncrease: Float? = null, preferredMinLiveStartPosition: Long? = null, preferredSeekForwardIncrementMs: Long? = DEFAULT_SEEK_FORWARD_INCREMENT_MS, preferredSeekBackIncrementMs: Long? = DEFAULT_SEEK_BACK_INCREMENT_MS, preferredBufferTimeoutMs: Long? = null, remoteStopLivePlaybackOnPause: Boolean? = null, handleAudioFocus: Boolean = true, preferredFallbackMinPlaybackSpeed: Float = DEFAULT_FALLBACK_MIN_PLAYBACK_SPEED, preferredFallbackMaxPlaybackSpeed: Float = DEFAULT_FALLBACK_MAX_PLAYBACK_SPEED, preferredTargetLiveOffsetIncrementOnRebufferMs: Long = DEFAULT_TARGET_LIVE_OFFSET_INCREMENT_ON_REBUFFER_MS, preferredMaxBitrate: Int? = null, preferredMinBitrate: Int? = null, preferredBackBufferDurationMs: Int = DEFAULT_BACK_BUFFER_DURATION_MS, preferredRetainBackBufferFromKeyframe: Boolean = DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME)

The PlaybackProperties instance with provided values.

Types

Link copied to clipboard
class Builder
Link copied to clipboard
object Companion

Default values of PlaybackProperties. Most values match ExoPlayer's version 2.18.4 default values.

Properties

Link copied to clipboard

Force enables/Disables the player handling of Media Codec in asynchronous mode and also enables/disables submission of buffers to the MediaCodec on a separate thread from the player. Default value is null i.e. the Android system determines whether the playback needs async codec processing or not. NOTE: This property can only be applied to runtime where android.os.Build.VERSION.SDK_INT>= 23

Link copied to clipboard

Is auto play enabled for playback. Default value is Boolean.false.

Link copied to clipboard

: if application attempts to play multiple players simultaneously, playback may pause due to loss of audio focus. To prevent this, set the handleAudioFocus parameter to false for multiple players. For single-player scenarios, ensure handleAudioFocus is set to true.

Link copied to clipboard

The initial start time (if any) for playback in milliseconds. By default, the playback starts from the beginning for VOD content and the live edge for Live content.

Link copied to clipboard

LiveStreamMonitorConfiguration The configuration for the live stream monitoring logic. NOTE: This property is only used when monitorLiveStream is set to Boolean.true.

Link copied to clipboard

An array of values from PlaybackStateCompat.Actions that are to be allowed externally via Android's MediaSession API i.e. not via the FL Player. Ex: Using Google Assistant voice commands. Default value is SUPPORTED_PLAYBACK_ACTIONS. Send an empty array to not allow any action. Any unsupported playback action will be ignored.

Link copied to clipboard

Is monitoring, of live stream, required to prevent the player from falling behind the media window and trying to request a media segment that is no longer available. Default value is Boolean.false.

Link copied to clipboard

Enables/Disables the monitoring of VFPO. Default value is Boolean.false.

Link copied to clipboard

The duration of media to retain in the buffer prior to the current playback position, for fast backward seeking. The default is DEFAULT_BACK_BUFFER_DURATION_MS.

Link copied to clipboard

The fraction of the available bandwidth that the selection should consider available for use. Setting to a value less than 1 is recommended to account for inaccuracies in the bandwidth estimator. Default value is 0.7F.

Link copied to clipboard

The default duration of media that must be buffered for playback to resume after a rebuffer, in milliseconds. A rebuffer is defined to be caused by buffer depletion rather than a user action. Default value is 5000.

For live streaming, the fraction of the duration from current playback position to the live edge that has to be buffered before the selected track can be switched to one of higher quality. This parameter is only applied when the playback position is closer to the live edge than preferredMinDurationForQualityIncreaseMs, which would otherwise prevent switching to a higher quality from happening.

Link copied to clipboard

The maximum duration the player tries to buffer else throws a timeout error, in milliseconds. This handle's the indefinite buffering on playback.

Link copied to clipboard

The duration for which the player tries to connect to the network before throwing a SocketTimeoutException. Default value is 8000.

Link copied to clipboard

Sets the maximum playback speed that should be used if no maximum playback speed is defined by the media. The default is DEFAULT_FALLBACK_MAX_PLAYBACK_SPEED.

Link copied to clipboard

Sets the minimum playback speed that should be used if no minimum playback speed is defined by the media. The default is DEFAULT_FALLBACK_MIN_PLAYBACK_SPEED.

Link copied to clipboard

The default duration of media that must be buffered for playback to start or resume following a user action such as a seek, in milliseconds. Default value is 2500.

Link copied to clipboard

Represents initial network bandwidth, in bits per second, that the player will attempt to use on startup for the optimal track variant selection.

Link copied to clipboard

The maximum bitrate in bits per second that the player will consider for adaptive streaming track selection on startup. Default value is null, indicating no specific maximum constraint.

Link copied to clipboard

The default maximum duration of media that the player will attempt to buffer, in milliseconds. Default value is 50000.

Link copied to clipboard

The maximum duration of buffered data required for the selected track to switch to one of lower quality. Default value is 25_000.

Link copied to clipboard

The maximum number of times that the playback recovery flow will attempt to load the Player to recover from non-fatal error prior to propagating the error by calling Player.Listener.onError. The default value is DEFAULT_MAX_PLAYBACK_RECOVERY_RETRY_COUNT

Link copied to clipboard

The maximum playback speed, the player can use to catch up when trying to reach the target live offset. Default value is null, indicating the player defined maximum playback speed will be used.

Link copied to clipboard

The minimum bitrate in bits per second that the player will consider for adaptive streaming track selection on startup. Default value is null, indicating no specific minimum constraint.

Link copied to clipboard

The default minimum duration of media that the player will attempt to ensure is buffered at all times, in milliseconds. Default value is 50000.

Link copied to clipboard

The minimum duration of buffered data, in milliseconds, required for the selected track to switch to one of higher quality. Default value is 10_000.

When switching to a video track of higher quality, the selection may indicate that media already buffered at the lower quality can be discarded to speed up the switch. This is the minimum duration of media that must be retained at the lower quality. It must be at least minDurationForQualityIncreaseMs. Default value is 25_000.

Link copied to clipboard

The minimum position to start the playback from. This is applicable only for a DASH live stream.

Link copied to clipboard

The default minimum number of times to retry loading data prior to propagating the error. Default value is 3.

Link copied to clipboard

The minimum playback speed, the player can use to fall back when trying to reach the target live offset. Default value is null, indicating the player defined minimum playback speed will be used.

Link copied to clipboard

The duration for which the player tries to read from the network before throwing a SocketTimeoutException. Default value is 8000.

Link copied to clipboard

Whether the back buffer is retained from the previous keyframe. If it's false then seeking in the back-buffer will only be fast if the back-buffer contains a keyframe prior to the seek position. The default is DEFAULT_RETAIN_BACK_BUFFER_FROM_KEYFRAME.

Link copied to clipboard

The seek back increment, in milliseconds.

Link copied to clipboard

The seek forward increment, in milliseconds.

Sets the increment applied to the target live offset each time the player is rebuffering, in milliseconds.

Link copied to clipboard

The target offset time from live edge in milliseconds. The player will attempt to get close to this live offset during playback. Default value is null, indicating the player calculated target offset time will be used.

Link copied to clipboard

, if application wants to stop the LIVE playback from the remote actions, set this flag to true. By default, it is false. NOTE: Currently is applicable for audio playback.

Link copied to clipboard

When enabled tunneled video playback makes it possible for AndroidTV device manufacturers to leverage hardware video decoding pipelines for playback. Default value is Boolean.false. NOTE: This property should be enabled only for the TV platform.

Link copied to clipboard

this property is applied only if monitorVFPO value is set to Boolean.true. The first value represents the lower boundary for the VFPO when we need to switch the video track variant to the next lower bitrate video variant. The second value represents the upper boundary for the VFPO when we need to switch the video track variant to the next higher bitrate video variant if the bitrate was caped previously. When monitorVFPO is set to false this property is not used. NOTE: VFPO (Video Frame Processing Offset Average) the metric to evaluate the rendering performance. VFPO measures how early the player processes a video frame compared to its presentation time, in microseconds. For example, if a video frame is processed by the player 30ms before the frame should be displayed on screen, the VFPO of this frame is 30000. Similarly, if a video frame is processed too late by 10ms (the player’s current position has progressed beyond the frame’s presentation time), the VFPO for this frame is -10000 (and the video frame is dropped). The smooth playback, without dropped frames or audio underruns, is expected when the average VFPO is above 40000. Video Frame Processing Offset Average is computed by taking a sum of VFPOs captured over a playback time period and dividing the sum by the number of VFPOs captured over the same time period. Default value is 15000L...40000L.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String