# Classes

The following classes are available globally.

- `AirPlayFactory`

  Create AirPlay client instance

  See more

  #### Declaration

  Swift

      public class AirPlayFactory : CastComponentFactoryProtocol

- `BroadpeakMetadata`

  BroadpeakMetadata

  See more

  #### Declaration

  Swift

      public class BroadpeakMetadata : AnalyticsMetadata

- `BroadpeakSettings`

  BroadpeakSettings

  See more

  #### Declaration

  Swift

      public class BroadpeakSettings

- `ChromecastMetadata`

  ChromecastMetadata

  See more

  #### Declaration

  Swift

      public class ChromecastMetadata : AnalyticsMetadata

- `ChromecastFactory`

  Create Chromecast client instance

  See more

  #### Declaration

  Swift

      public class ChromecastFactory : CastComponentFactoryProtocol

- `ConvivaFactory`

  Create Appium client instance

  See more

  #### Declaration

  Swift

      public class ConvivaFactory : AnalyticsComponentFactoryProtocol

- `ConvivaMetadata`

  ConvivaMetadata

  See more

  #### Declaration

  Swift

      public class ConvivaMetadata : AnalyticsMetadata

- `ConvivaSettings`

  ConvivaSettings

  See more

  #### Declaration

  Swift

      public class ConvivaSettings

### IMA

- `IMA`
  See more

  #### Declaration

  Swift

      public class IMA: BaseComponent, IMAContentPlayhead, IMAAdsLoaderDelegate, IMAAdsManagerDelegate,
          ViewBasedComponentProtocol

      extension IMA: AdsComponentProtocol

      extension IMA: AdsAPI

- `IMAFactory`

  Create IMA client instance

  See more

  #### Declaration

  Swift

      public class IMAFactory : AdsComponentFactoryProtocol

- `MuxFactory`

  Create Mux client instance

  See more

  #### Declaration

  Swift

      public class MuxFactory : AnalyticsComponentFactoryProtocol

- `MuxMetadata`

  MuxMetadata

  See more

  #### Declaration

  Swift

      public class MuxMetadata : AnalyticsMetadata

- `MuxSettings`
  See more

  #### Declaration

  Swift

      public class MuxSettings

- `SubtitlesFactory`

  Create IMA client instance

  See more

  #### Declaration

  Swift

      public class SubtitlesFactory : SubtitlesComponentFactoryProtocol

- `ThumbnailsFactory`

  Create Thumbnails client instance

  See more

  #### Declaration

  Swift

      public class ThumbnailsFactory : ThumbnailsComponentFactoryProtocol

- `VTWithWidevinePlugin`

  CastlabsVT

  See more

  #### Declaration

  Swift

      public class VTWithWidevinePlugin : CLPluginProtocol

- `WidevineDrmFactory`
  See more

  #### Declaration

  Swift

      public class WidevineDrmFactory : DrmComponentFactoryProtocol

- `YouboraFactory`

  Create Youbora client instance

  See more

  #### Declaration

  Swift

      public class YouboraFactory : AnalyticsComponentFactoryProtocol

- `YouboraMetadata`

  YouboraMetadata

  See more

  #### Declaration

  Swift

      public class YouboraMetadata : AnalyticsMetadata

- `YouboraSettings`

  YouboraSettings

  See more

  #### Declaration

  Swift

      public class YouboraSettings

- `BasePlayer`

  BasePlayer implements all properties that are updated from the State and must be synchronised on ‘playerQueue’

  See more

  #### Declaration

  Swift

      open class BasePlayer : BaseInterceptable

- `BasePlayerStateSubscriber`

  Cross-component communication move outside factory

  See more

  #### Declaration

  Swift

      open class BasePlayerStateSubscriber : InternalStateSubscriberProtocol

- `DefaultPhoneCallHandler`

  Default handler for phone call interruption

  #### Declaration

  Swift

      public class DefaultPhoneCallHandler

- `AnalyticsMetadata`

  The meta-data class wraps and mandatory and optional meta-data that are send to various analytics backends.

  The two parameters that are mandatory in all cases are `live` and `assetId`. The `live` flag needs to be set to `true` if the content is a live stream. Analytics backends usually require this information before playback starts. The `assetId` identifies the content uniquely within the analytics system.

  #### Declaration

  Swift

      open class AnalyticsMetadata

- `CastSettings`

  The cast settings class wraps common settings for Chromecast `appId` is mandatory for casting.

  See more

  #### Declaration

  Swift

      open class CastSettings

### Download

- `Download`

  Download

  See more

  #### Declaration

  Swift

      open class Download : Codable

- `DownloadProgress`

  MediaDownloadProgress

  See more

  #### Declaration

  Swift

      public class DownloadProgress : Codable

- `DrmConfiguration`

  DRM configuration used for protected playback.

  See more

  #### Declaration

  Swift

      @objc
      public class DrmConfiguration : NSObject, NSCopying, Codable

### PlayerConfiguration

- `PlayerConfiguration`

  This structure describes player configuration for a single asset.

  ### ClearKey usage

      guard let url = URL(string: "STREAM-URL") else { return }

      let config = PlayerConfiguration(with: url)
      config.contentType = .hls

      let player = PRESTOplaySDK.shared.player()
      player.open(config: config)

  ### FairPlay usage

      guard let url = URL(string: "STREAM-URL") else { return }

      let config = PlayerConfiguration(with: url)
      config.contentType = .hls
      config.drmSystem = .fairplay
      config.drmConfiguration = DrmConfiguration()
      config.drmConfiguration?.environment = .production
      config.drmConfiguration?.userId = "..."
      config.drmConfiguration?.sessionId = "..."
      config.drmConfiguration?.merchant = "..."
      config.drmConfiguration?.assetId = "..."
      config.drmConfiguration?.variantId = "..."

      let player = PRESTOplaySDK.shared.player()
      player.open(config: config)

  ### Custom RequestModifier usage

  Example showing custom FairPlay URLs.

      guard let url = URL(string: "STREAM-URL") else { return }

      let config = PlayerConfiguration(with: url)
      config.contentType = .hls
      config.drmSystem = .fairplay
      config.drmConfiguration = DrmConfiguration()
      config.drmConfiguration?.licensingUrl = URL(string: "LICENSING-URL")
      config.drmConfiguration?.certificateUrl = URL(string: "CERTIFICATE-URL")

      // Add request/response modifiers on SDK level.
      PRESTOplaySDK.shared.requestModifiers.append(RequestModifier())
      PRESTOplaySDK.shared.responseModifiers.append(ResponseModifier())

      let player = PRESTOplaySDK.shared.player()
      player.open(config: config)

  See more

  #### Declaration

  Swift

      @objc
      public class PlayerConfiguration : NSObject, NSCopying, Codable

### Tracks

- `Tracks`

  Container that groups all available media tracks by type.

  See more

  #### Declaration

  Swift

      public class Tracks : Equatable, CustomStringConvertible

### VideoTrack

- `VideoTrack`

  Video track metadata and available renditions.

  See more

  #### Declaration

  Swift

      public class VideoTrack : Track, Equatable, CustomStringConvertible

### AudioTrack

- `AudioTrack`

  Audio track metadata and available renditions.

  See more

  #### Declaration

  Swift

      public class AudioTrack : Track, Equatable, CustomStringConvertible

### TextTrack

- `TextTrack`

  Text track metadata (subtitles/captions) and rendering hints.

  See more

  #### Declaration

  Swift

      public class TextTrack : Track, Equatable, CustomStringConvertible

### Rendition

- `Rendition`

  Base rendition metadata shared by audio/video rendition variants.

  See more

  #### Declaration

  Swift

      public class Rendition : Equatable

### AudioRendition

- `AudioRendition`

  Audio-specific rendition type.

  #### Declaration

  Swift

      public class AudioRendition : Rendition

### VideoRendition

- `VideoRendition`

  Video-specific rendition type with geometry/trickplay metadata.

  See more

  #### Declaration

  Swift

      public class VideoRendition : Rendition

### DrmInfo

- `DrmInfo`

  DRM metadata attached to renditions.

  See more

  #### Declaration

  Swift

      public class DrmInfo : Equatable

- `CorePlugins`

  CastlabsApple

  See more

  #### Declaration

  Swift

      @objc
      public class CorePlugins : NSObject, CLPluginProtocol

- `CmcdConfiguration`

  The CMCD Configuration

  See more

  #### Declaration

  Swift

      public class CmcdConfiguration : NSObject, NSCopying, Codable

- `NetworkConfiguration`

  Discussion: Apple uses predefined network sessions called URLSession. There is no way to create a dedicated URLSession for each Request. If ‘NetworkConfiguration’ is updated it will affect the whole URLSession, which is shared for all the HTTP/S requests in ‘NetworkEngine’.

  See more

  #### Declaration

  Swift

      public class NetworkConfiguration : NSObject, NSCopying, Codable

- `StateTimeoutConfiguration`

  Configuration for per-state timeouts of the player state machine. Values are in seconds. Use 0 to disable a timeout for a state.

  See more

  #### Declaration

  Swift

      public class StateTimeoutConfiguration : NSObject, NSCopying, Codable

- `HLSSettings`

  HLS settings shared by the Apple HLS player and downloader.

  See more

  #### Declaration

  Swift

      public class HLSSettings

- `SubtitlesStyle`

  The subtitles settings to customize subtitles rendering.

  See more

  #### Declaration

  Swift

      public class SubtitlesStyle : NSObject

- `GridThumbnail`

  GridThumbnail

  Used to define a request to download images and slice them into multiple thumbnails in a grid pattern. Each image will be sliced into smaller segments based on the `gridWidth` and `gridHeight`. E.g. if these are both set to `2`, then the image will be divided into a 2 x 2 grid producing 4 equal sized thumbnails per image. The grid cells are ordered from left to right, then top to bottom.

  Single or multiple images may be downloaded using this object. If `maxIndex` is greater than 1 and the `pathTemplate` contains the token index then multiple image urls can be specified. The final image urls which will be downloaded are specified by the baseUrl + the result of the pathTemplate substitution. The index token in pathTemplate will be substituted with the index 1 up to and including maxIndex. E.g. if `pathTemplate` where `image_$index$.jpg` and maxIndex were 3, then `image_1.jpg`, `image_2.jpg`, `image_3.jpg` would be generated from the substitution.

  Each thumbnail will be displayed for `durationMs` with no gabs in between. Therefore thumbnails will cover a total timerange of `durationMs` multiplied by the total number of thumbnails generated.

  See more

  #### Declaration

  Swift

      public class GridThumbnail

- `ThumbnailImage`

  Defines a single thumbnail image along with it’s timing information.

  See more

  #### Declaration

  Swift

      public class ThumbnailImage

### Utils

- `Utils`

  mack: I think this should be internal only

  See more

  #### Declaration

  Swift

      public class Utils : NSObject