Protocols

The following protocols are available globally.

  • Defines basic properties available for every ad type

    See more

    Declaration

    Objective-C

    @protocol BMPAd <NSObject, _BMPJsonEncodable>

    Swift

    protocol Ad : _JsonEncodable
  • Contains information about an ad break.

    See more

    Declaration

    Objective-C

    @protocol BMPAdBreak <BMPAdConfig, _BMPJsonEncodable>

    Swift

    protocol AdBreak : AdConfig
  • Contains config options for an AdBreak.

    See

    BMPAdBreak
    See more

    Declaration

    Objective-C

    @protocol BMPAdBreakConfig <BMPAdTagConfig>

    Swift

    protocol AdBreakConfig : AdTagConfig
  • Contains the base config options for an ad.

    See more

    Declaration

    Objective-C

    @protocol BMPAdConfig <_BMPJsonEncodable>

    Swift

    protocol AdConfig : _JsonEncodable
  • Holds various additional ad data.

    See

    ImaAdData for more information on what additional data is available when using the Google IMA SDK implementation.
    See more

    Declaration

    Objective-C

    @protocol BMPAdData <_BMPJsonEncodable>

    Swift

    protocol AdData : _JsonEncodable
  • Contains config options for an AdTag.

    See

    BMPAdTag
    See more

    Declaration

    Objective-C

    @protocol BMPAdTagConfig <BMPAdConfig>

    Swift

    protocol AdTagConfig : AdConfig
  • Listener protocol which can be used to listen to events of the BMPBitmovinCastManager.

    See more

    Declaration

    Objective-C

    @protocol BMPBitmovinCastManagerListener <NSObject>

    Swift

    protocol BitmovinCastManagerListener : NSObjectProtocol
  • Provides the means to configure buffer settings and to query the current buffer state. Accessible through Player.buffer.

    See more

    Declaration

    Objective-C

    @protocol BMPBufferApi <NSObject>

    Swift

    protocol BufferApi : NSObjectProtocol
  • Contains IMA specific information about an AdBreak.

    See

    BMPAdBreak

    Declaration

    Objective-C

    @protocol BMPImaAdBreak <BMPAdBreak, BMPImaAdBreakConfig>

    Swift

    protocol ImaAdBreak : AdBreak, ImaAdBreakConfig
  • Contains IMA specific AdBreakConfig options.

    See

    BMPAdBreakConfig

    Declaration

    Objective-C

    @protocol BMPImaAdBreakConfig <BMPAdBreakConfig, BMPImaAdTagConfig>

    Swift

    protocol ImaAdBreakConfig : AdBreakConfig, ImaAdTagConfig
  • Holds additional ad data that’s available when using the Google IMA SDK implementation.

    See more

    Declaration

    Objective-C

    @protocol BMPImaAdData <BMPVastAdData>

    Swift

    protocol ImaAdData : VastAdData
  • Contains IMA specific AdTagConfig options.

    Declaration

    Objective-C

    @protocol BMPImaAdTagConfig <BMPAdTagConfig>

    Swift

    protocol ImaAdTagConfig : AdTagConfig
  • Defines a linear ad which requires the playback of the content to stop

    See more

    Declaration

    Objective-C

    @protocol BMPLinearAd <BMPAd>

    Swift

    protocol LinearAd : Ad
  • Is linked to one SourceConfig and is used to manage offline content and offline DRM related tasks for this single SourceConfig.

    IMPORTANT: Methods from OfflineContentManager need to be called from the main thread.

    This class offers functionality to handle the whole lifecycle of protected and unprotected offline content.

    Depending on the current state of the SourceConfig, which is represented by offlineState, different methods are allowed to be called. The table below shows all possible and allowed transitions between the different states. Each line describes one transition which happens immediately and synchronously. When there is a method call noted in column “Method call triggering transition”, the “Following State” is entered immediately after the method call returns.

    When there is no method call noted, the “Following State” is entered when the event described in column “OfflineContentManagerListener event” was received.

    The “Following State” is always noted under the assumption that no error occurred when calling the transition method, or during processing of the current task. Errors are always reported to onError(_:,offlineContentManager:). See the documentation of OfflineContentManagerListener for more information.

    Calling any method in an invalid state will not result in any state change.

    Current State Method call triggering transition OfflineContentManagerListener event Following State
    NotDownloaded download - Downloading
    Downloading cancelDownload - Canceling
    Downloading suspendDownload onContentDownloadSuspended Suspended
    Downloading - onContentDownloadFinished Downloaded
    Downloading - onContentDownloadProgressChanged Downloading
    Downloaded deleteOfflineData - NotDownloaded
    Suspended resumeDownload onContentDownloadResumed Downloading
    Suspended cancelDownload - Canceling
    Canceling - onContentDownloadCanceled NotDownloaded
    Downloaded renewOfflineLicense onOfflineContentLicenseRenewed Downloaded
    See more

    Declaration

    Objective-C

    @protocol
        BMPOfflineContentManager <NSObject, BMPOfflineContentManagerEventHandler>

    Swift

    protocol OfflineContentManager : OfflineContentManagerEventHandler
  • Manages listeners to specific OfflineContentManagers and notifies those listeners

    See more

    Declaration

    Objective-C

    @protocol BMPOfflineContentManagerEventHandler <NSObject>
  • Defines an ad which gets displayed during content playback

    Declaration

    Objective-C

    @protocol BMPOverlayAd <BMPAd>

    Swift

    protocol OverlayAd : Ad
  • Loads, controls and renders audio and video content represented through Sources. A player instance can be created via the PlayerFactory.create function and will idle until one or more Sources are loaded. Once load is called, the player becomes active and initiates necessary downloads to start playback of the loaded source(s).

    In case multiple sources were loaded into the player, Source.isActive identifies which source is currently active in the player (i.e. being played back). Only one source can be active at any time and API calls on the player will act on that source. More information on how to manage multiple sources can be found on the PlaylistApi.

    The player emits events during a player session. See PlayerEventHandler on how to subscribe to events. Events are divided into PlayerEvent and SourceEvent, depending on if they are specific to a player session or a source. While SourceEvents are naturally emitted from a source, they are also emitted from the player for the active source. This allows for all event handling to be done through the player in case only a single source is loaded, enabling the same workflows as on v2 of the Bitmovin Player SDK, where it was not possible to load multiple sources and where each event was a PlayerEvent.

    The player implements the RemoteControlApi, which offers the ability to connect to a cast-compatible device, allowing remote playback of the loaded sources.

    By default, a player instance does not provide any UI components. To use the default Bitmovin Player Web UI, a player instance can be attached to a PlayerView. The PlayerView already comes with a Layer to render video into, the Bitmovin Player Web UI and handling for standard UI use-cases. If a custom UI is preferred, an AVPlayerLayer or an AVPlayerViewController can be registered via registerPlayerLayer / registerPlayerViewController. See PlayerView for more details.

    See more

    Declaration

    Objective-C

    @protocol BMPPlayer <NSObject, BMPPlayerEventHandler, BMPRemoteControlApi>

    Swift

    protocol Player : PlayerEventHandler, RemoteControlApi
  • Manages listeners to specific PlayerEvents and notifies those listeners when such an event is being emitted. Listeners need to conform to the PlayerListener protocol. See PlayerListener about possible event method implementations.

    See more

    Declaration

    Objective-C

    @protocol BMPPlayerEventHandler <NSObject>

    Swift

    protocol PlayerEventHandler : NSObjectProtocol
  • Provides the means to initiate and manage casting of video to a cast-compatible remote device. Only available on iOS. Result in a no-op on tvOS for all properties and methods.

    See more

    Declaration

    Objective-C

    @protocol BMPRemoteControlApi <NSObject>

    Swift

    protocol RemoteControlApi : NSObjectProtocol
  • Defines listener methods for all events available for the PlayerView. See the documentation of the single listener methods for further information.

    See more

    Declaration

    Objective-C

    @protocol BMPUserInterfaceListener <NSObject>

    Swift

    protocol UserInterfaceListener : NSObjectProtocol
  • Holds various additional ad data that’s available in the VAST response.

    See more

    Declaration

    Objective-C

    @protocol BMPVastAdData <BMPAdData>

    Swift

    protocol VastAdData : AdData
  • Provides the means to manage the playlist.

    When the player transitions from one source in the playlist to another (either by normal playback or by seeking), a PlaylistTransition event is emitted and the new Source becomes active while the old one becomes inactive.

    Accessible through Player.playlist.

    See more

    Declaration

    Swift

    @objc(BMPPlaylistApi)
    public protocol PlaylistApi
  • API methods related to the user interface.

    See more

    Declaration

    Swift

    @objc(BMPUserInterfaceApi)
    public protocol UserInterfaceApi : NSObjectProtocol
  • Manages listeners to specific SourceEvent and notifies those listeners when such an event is being emitted. Listeners need to conform to the SourceListener protocol. See SourceListener about possible event method implementations.

    See more

    Declaration

    Swift

    @objc(BMPSourceEventHandler)
    public protocol SourceEventHandler
  • Handles adding and removing of event listeners.

    See more

    Declaration

    Swift

    @objc(BMPUserInterfaceEventHandler)
    public protocol UserInterfaceEventHandler : NSObjectProtocol
  • Declaration

    Swift

    @objc(BMPCueEvent)
    public protocol CueEvent
  • Base protocol for all event classes.

    See more

    Declaration

    Swift

    @objc(BMPEvent)
    public protocol Event : NSObjectProtocol
  • Protocol for all SourceEvent classes.

    Declaration

    Swift

    @objc(BMPSourceEvent)
    public protocol SourceEvent : Event
  • Base protocol for all PlayerViewEvent classes.

    Declaration

    Swift

    @objc(BMPPlayerViewEvent)
    public protocol PlayerViewEvent : Event
  • Defines listener methods for all events available for the Player.

    See more

    Declaration

    Swift

    @objc(BMPPlayerListener)
    public protocol PlayerListener : NSObjectProtocol
  • Includes all possible methods that an implementation of this protocol can implement. The corresponding method will be called when an event is emitted (if implemented).

    See more

    Declaration

    Swift

    @objc(BMPSourceListener)
    public protocol SourceListener : NSObjectProtocol
  • This protocol can be implemented to gather more detailed information about what is happening within the SDK for all top-level entities and APIs. For example, Player, Source and PlayerView entities, as well as Offline components.

    It is implemented by default within the SDK to print a single log entry to the console. A log entry contains details such as log level, which entity or API is sending the log, a log message, the date and time the log entry was created, and if applicable, a warning or error code and extra data about the warning or error. See LogEntry for more details.

    To create your own custom logger to receive and optionally print a log entry in your integration, provide an instance that conforms to this protocol. An example custom logger is:

    public class CustomLogger: Logger {
        public var level: LogLevel = .info
    
        func log(_ logEntry: LogEntry) {
            var logDetails: [String] = []
            logDetails.append("[\(logEntry.sender)]")
            logDetails.append("[\(logEntry.level)]")
            logDetails.append("\(logEntry.message)")
    
            if let code = logEntry.code {
                logDetails.append("code: \(code)")
            }
    
            if let data = logEntry.data {
                var dataDetails: [String] = []
                dataDetails.append("Data code: \(data.code), message: \(data.message)")
    
                if let dataError = data.underlyingError {
                    dataDetails.append("underlying error: \(dataError)")
                }
    
                logDetails.append("[" + dataDetails.joined(separator: ", ") + "]")
            }
    
            print("[CustomLog] \(logDetails.joined(separator: " "))")
        }
    }
    

    To implement your custom logger, assign it as the logger in the logging config:

        DebugConfig.logging.logger = CustomLogger()
    
    See more

    Declaration

    Swift

    @objc(BMPLogger)
    public protocol Logger
  • The ImaAdsManager protocol can be used to interact with the underlying Google IMA SDK during ad playback

    See more

    Declaration

    Swift

    @objc(BMPImaAdsManager)
    public protocol ImaAdsManager
  • A delegate protocol that can be used to change request parameters before a request is made.

    • Example implementation of PreprocessHttpRequestDelegate.
    class MyPreprocessHttpRequestDelegate: PreprocessHttpRequestDelegate {
        func preprocessHttpRequest(
            _ type: String,
            httpRequest: HttpRequest,
            completionHandler: @escaping (_ httpRequest: HttpRequest) -> Void
        ) {
            var modifiedRequest = httpRequest
    
            // Modify the request based on the type
            switch type {
            case HttpRequestType.drmLicenseFairplay.rawValue:
                // Example modification for DRM requests
                modifiedRequest.headers["Authorization"] = "Bearer someAccessToken"
            case HttpRequestType.manifestHlsMaster.rawValue:
                // Example modification for HLS Playlist requests
                modifiedRequest.url = modifiedRequest.url.appendingPathComponent("modified")
            default:
                break
            }
    
            // Call the completion handler with the modified request
            completionHandler(modifiedRequest)
        }
    }
    
    See more

    Declaration

    Swift

    @available(*, deprecated, message: "Use NetworkConfig.preprocessHttpRequest instead.")
    @objc(BMPPreprocessHttpRequestDelegate)
    public protocol PreprocessHttpRequestDelegate
  • Represents a timeline marker that can be visualized in the player UI. It can represent a point in time or a time range.

    See more

    Declaration

    Swift

    @objc(BMPTimelineMarker)
    public protocol TimelineMarker
  • Enables external control over the associated BMPSubtitleTrack

    See more

    Declaration

    Swift

    @objc(BMPSubtitleTrackController)
    public protocol SubtitleTrackController : NSObjectProtocol
  • Declaration

    Swift

    @objc(BMPMetadataEntry)
    public protocol MetadataEntry
  • Represents audio and video content that can be loaded into a Player. A Source instance can be created via the SourceFactory.create function and will idle until it is loaded into a player. After loading the source into a player, isAttachedToPlayer is true and the same source can not be loaded into a different player until unloaded.

    Multiple sources can be loaded into a player as part of a PlaylistConfig, where the first source in the playlist immediately becomes active. When the player transitions to another source in the playlist, that source becomes active. More information on how to manage multiple sources can be found on the PlaylistApi.

    The source starts out LoadingState.unloaded, transitions to LoadingState.loading once the source starts loading and finally transitions to LoadingState.loaded when it finished loading. When unloaded from a player, the source reverts to being LoadingState.unloaded and detached. After this, the source can be loaded again into a (different) player.

    The source emits events while it is attached to a player. See SourceEventHandler on how to subscribe to events. The source only emits events of type SourceEvent, and events that are emitted while the source is active are also emitted through the player it is attached to.

    Only a few events are currently emitted from the source. This is a temporary limitation until all source events are emitted correctly from the source. See SourceListener for more information about events emitted from the source.

    See more

    Declaration

    Swift

    @objc(BMPSource)
    public protocol Source : SourceEventHandler
  • This API is used as an incubator for experimental features. Tweaks are not officially supported and are not guaranteed to be stable, i.e. their naming, functionality and API can change at any time within the tweaks or when being promoted to an official feature and moved into its final configuration namespace.

    See more

    Declaration

    Swift

    @objc(BMPOfflineContentManagerTweaksApi)
    public protocol OfflineContentManagerTweaksApi
  • Protocol for listeners for the OfflineContentManager.

    See more

    Declaration

    Swift

    @objc(BMPOfflineContentManagerListener)
    public protocol OfflineContentManagerListener : NSObjectProtocol
  • Protocol for delegate for the OfflineManager.

    See more

    Declaration

    Swift

    @objc(BMPOfflineManagerDelegate)
    public protocol OfflineManagerDelegate : NSObjectProtocol
  • See OfflineContentManagerListener for more information on this event.

    See more

    Declaration

    Swift

    @objc(BMPAvailableTracksFetchedEvent)
    public protocol AvailableTracksFetchedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    Declaration

    Swift

    @objc(BMPContentDownloadCanceledEvent)
    public protocol ContentDownloadCanceledEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    Declaration

    Swift

    @objc(BMPContentDownloadFinishedEvent)
    public protocol ContentDownloadFinishedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    See more

    Declaration

    Swift

    @objc(BMPContentDownloadProgressChangedEvent)
    public protocol ContentDownloadProgressChangedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    See more

    Declaration

    Swift

    @objc(BMPContentDownloadResumedEvent)
    public protocol ContentDownloadResumedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    Declaration

    Swift

    @objc(BMPContentDownloadSuspendedEvent)
    public protocol ContentDownloadSuspendedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    See more

    Declaration

    Swift

    @objc(BMPContentUrlMigrationFinishedEvent)
    public protocol ContentUrlMigrationFinishedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    Declaration

    Swift

    @objc(BMPOfflineContentLicenseExpiredEvent)
    public protocol OfflineContentLicenseExpiredEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    Declaration

    Swift

    @objc(BMPOfflineContentLicenseRenewedEvent)
    public protocol OfflineContentLicenseRenewedEvent : OfflineEvent
  • See OfflineContentManagerListener for more information on this event.

    See more

    Declaration

    Swift

    @objc(BMPOfflineErrorEvent)
    public protocol OfflineErrorEvent : OfflineEvent
  • Protocol for all OfflineEvent classes.

    Declaration

    Swift

    @objc(BMPOfflineEvent)
    public protocol OfflineEvent : Event
  • A representation of a temporary break in participation.

    See SharePlayApi.beginSuspension(for:) method for details on use.

    See more

    Declaration

    Swift

    @available(iOS 15.0, tvOS 15.0, *)
    @objc(BMPSharePlaySuspension)
    public protocol SharePlaySuspension
  • The FullscreenHandler implementation can be set on a PlayerView using its fullscreenHandler property. The FullscreenHandler acts as a delegate for handling the fullscreen related behaviour of the player view.

    See more

    Declaration

    Swift

    @objc(BMPFullscreenHandler)
    public protocol FullscreenHandler : NSObjectProtocol
  • The SystemUiApi for interactions regarding the system UI. Using this API just has an effect if userInterfaceType in StyleConfig is set to .system. This is the default value on tvOS, on iOS it has to be set specifically.

    See more

    Declaration

    Swift

    @objc(BMPSystemUiApi)
    public protocol SystemUiApi
  • Methods for handling received messages from Bitmovin Web UI.

    See more

    Declaration

    Swift

    @objc(BMPCustomMessageHandlerDelegate)
    public protocol CustomMessageHandlerDelegate
  • The PictureInPictureApi for interactions regarding picture in picture feature.

    See more

    Declaration

    Swift

    @objc(BMPPictureInPictureApi)
    public protocol PictureInPictureApi
  • This API is used as an incubator for experimental features. Tweaks are not officially supported and are not guaranteed to be stable, i.e. their naming, functionality and API can change at any time within the tweaks or when being promoted to an official feature and moved into its final configuration namespace.

    See more
  • Protocol for listeners for the OfflineContentManager.

    See more
  • Protocol for delegate for the OfflineManager.

    See more
  • See OfflineContentManagerListener for more information on this event.

    See more
  • See OfflineContentManagerListener for more information on this event.

  • See OfflineContentManagerListener for more information on this event.

  • See OfflineContentManagerListener for more information on this event.

    See more
  • See OfflineContentManagerListener for more information on this event.

    See more
  • See OfflineContentManagerListener for more information on this event.

  • See OfflineContentManagerListener for more information on this event.

    See more
  • See OfflineContentManagerListener for more information on this event.

  • See OfflineContentManagerListener for more information on this event.

  • See OfflineContentManagerListener for more information on this event.

    See more
  • Protocol for all OfflineEvent classes.

  • Methods for handling received messages from Bitmovin Web UI.

    See more
  • Declaration

    Swift

    @objc(BPAAnalyticsSsaiApi)
    public protocol AnalyticsSsaiApi
  • Provides an API to interact with the Analytics Collector of a Player

    See more

    Declaration

    Swift

    @objc(BPAPlayerAnalyticsApi)
    public protocol PlayerAnalyticsApi
  • Provides an API to control Analytics of a Source.

    See more

    Declaration

    Swift

    @objc(BPASourceAnalyticsApi)
    public protocol SourceAnalyticsApi