PRESTOplaySDK Class

public class PRESTOplaySDK

Main interface for initializing the SDK and additional plugins.

Public

  • Returns the globally shared SDK instance.

    Declaration

    Swift

    public static let shared: PRESTOplaySDK
  • Report most recent error / warning

    Declaration

    Swift

    public var onError: ErrorHandler?
  • Returns the authentication key for the device. Client is responsible for implementing this method.

    Declaration

    Swift

    public var onDeviceAuthTokenRequired: AuthTokenHandler?
  • Returns the authentication key for AirPlay. Client is responsible for implementing this method.

    Declaration

    Swift

    public var onAirplayAuthTokenRequired: AuthTokenHandler?
  • Initialises the SDK. This method should be called before any other.

    Only the first call to this method is honoured. Subsequent calls are no-ops.

    Declaration

    Swift

    public func register(
        _ license: String,
        _ plugins: [CLPluginProtocol],
        _ companion: CompanionSDK? = nil
    ) -> LicenseCheck

    Parameters

    license

    License description.

    plugins

    Array of plugin to be enabled.

    companion

    Companion SDK metadata.

    Return Value

    Initialization result.

  • Sets the logging verbosity.

    Declaration

    Swift

    public func setLogLevel(_ level: CLLogLevel)

    Parameters

    level

    Log level.

  • Creates player without configuration.

    Configuration can be loaded later with load method.

    Declaration

    Swift

    public func player() -> PlayerAPI

    Return Value

    Common player interface.

  • Creates player for given configuration.

    Declaration

    Swift

    public func player(for config: PlayerConfiguration) -> PlayerAPI?

    Parameters

    config

    Player configuration.

    Return Value

    Player instance.

  • Creates a PlayerViewControllerAPI instance with the channel items and analytics data.

    Declaration

    Swift

    @available(tvOS 15.0, *)
    public func playerViewController(
        channels: [ChannelItem],
        analytics: [AnalyticsBackend?: AnalyticsMetadata]?,
        loopChannels: Bool)
        -> PlayerViewControllerAPI?

    Parameters

    channels

    Array of channel items to be played.

    analytics

    AnalyticsBackend instance and the necessary metadata for analytics.

    loopChannels

    Loop the channel list at the first or last channel.

    Return Value

    An optional PlayerViewControllerAPI instance.

  • Initializes cast with cast settings.

    At this point authorization requests are triggered if required.

    Declaration

    Swift

    public func cast(for castSettings: CastSettings) -> CastAPI?

    Parameters

    castSettings

    Cast settings.

    Return Value

    Instance of cast.

  • Creates DRM Prefetcher for given configuration.

    Declaration

    Swift

    public func prefetcher(for config: PlayerConfiguration) -> CLDrmPrefetcherAPI?

    Parameters

    config

    Player configuration.

    Return Value

    DRM prefetcher instance.

  • Creates downloader without configuration.

    Configuration can be loaded later with createDownload method.

    Declaration

    Swift

    public func downloader() -> DownloaderAPI

    Return Value

    Common downloader interface.

  • Returns the Advertisements client.

    Declaration

    Swift

    public func ads(for player: PlayerAPI) -> AdsAPI?

    Parameters

    player

    Current player instance.

    Return Value

    Advertisment instance.

  • Creates an Analytics client for a given player and analytics backend.

    Declaration

    Swift

    public func analytics(
        for player: PlayerAPI,
        _ backend: AnalyticsBackend? = nil)
        -> AnalyticsAPI?

    Parameters

    player

    Player instance.

    backend

    Analytics backend.

  • Returns the Subtitles client for a given player.

    Declaration

    Swift

    public func subtitles(for player: PlayerAPI,
                          callbacksQueue: DispatchQueue? = nil) -> SubtitlesAPI?

    Parameters

    player

    Current player instance.

    Return Value

    Subtitles client.

  • Returns the Thumbnails client for a given player.

    Declaration

    Swift

    public func thumbnails(for player: PlayerAPI) -> ThumbnailsAPI?

    Parameters

    player

    Current player instance.

    Return Value

    Thumbnails client.

  • Returns the playlist api client.

    Declaration

    Swift

    public func playlist(
        for player: PlayerAPI,
        mode: PlaylistMode = .playerRecreate,
        loopList: Bool? = true
    ) -> PlaylistAPI?

    Parameters

    player

    Current player instance.

    mode

    Playlist mode.

    loopList

    Loops the playlist. Default is true. False value is effective only in .nativeQueue mode.

    Return Value

    Playlist manager instance.