# Utils Class

    public class Utils : NSObject

mack: I think this should be internal only

- `willLoadAsset`

  Test seam: invoked at the start of `loadAsset`, before the `AVURLAsset` is created, with the configuration that will be used. Lets tests observe asset-creation order and the `redirectedUrl` in effect at creation time. Not used in production.

  #### Declaration

  Swift

      public static var willLoadAsset: ((PlayerConfiguration) -> Void)?

- `areTimeRangesGreaterThan(_:_:)`

  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

- `sanitizeSeekTime(_:withPlaybackDuration:preferredLiveSeekMin:)`

  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.

- `mapToDRMTodayErrors(_:)`

  Maps DRMToday HTTP Response to Error

  #### Declaration

  Swift

      public static func mapToDRMTodayErrors(_ response: Any?) -> PRESTOerror?

  #### Parameters

  `response` | DRMToday response

  #### Return Value

  error