Utils Class

public class Utils : NSObject

mack: I think this should be internal only

  • Choose the longest duration

    Declaration

    Swift

    public static func areTimeRangesGreaterThan(
        _ first: [CMTimeRange],
        _ second: [CMTimeRange]) -> Bool

    Parameters

    first

    first array of ranges

    second

    second array of ranges

    Return Value

    return true if second is larger than first

  • Sanitizes a seek time to ensure it falls within valid bounds for VOD and live streams.

    Declaration

    Swift

    public static func sanitizeSeekTime(
        _ seekTime: CMTime,
        withPlaybackDuration duration: CMTime,
        preferredLiveSeekMin: Int64
    ) -> CMTime

    Parameters

    seekTime

    The desired seek time.

    duration

    The media duration. For live streams this can be .indefinite.

    preferredLiveSeekMin

    Minimum allowed seek time (in seconds) for live streams to avoid seeking too close to 0.

    Return Value

    A clamped and valid CMTime for seeking.