SourceLatencyApi

@objc(BMPSourceLatencyApi)
@objcMembers
public class SourceLatencyApi : NSObject

Provides the means to manage latency for a live-stream on a Source. Accessible through Source.latency.

Note

Disable PlayerConfig.tweaksConfig.isCustomHlsLoadingEnabled when intending to play HLS-LL streams below iOS and tvOS 17. Due to platform limitations, HLS-LL streams are not supported there while this property is enabled.
  • Specifies if the player should try to automatically restore the previous playback position after a stall.

    Setting a new value requires that the Source is attached to a Player to take effect. Set the initial value using SourceLiveConfig.automaticallyPreservesLatency instead.

    If set to true, the player will time shift to the last playback position after a stall ended (does not have to be the configured targetLatency). For example, when the player stalls after calling player.timeShift = -10, it will try to restore the -10 seconds time shift automatically.

    Note

    If the network cannot deliver media quickly enough playback may stall endlessly.

    Does not have any effect for VOD assets.

    Declaration

    Swift

    public var automaticallyPreservesLatency: Bool { get set }
  • Provides the system’s recommended latency.

    Returns the PART-HOLD-BACK value from the manifest if present. If there is no PART-HOLD-BACK value found, if returns an appropriate value. E.g. three times the segment duration.

    Returns .nan for VOD assets.

    Declaration

    Swift

    public var recommendedLatency: TimeInterval { get }