Protocols

The following protocols are available globally.

  • 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
  • Can be used to change request parameters before a request is made.

    Only changing DRM and HLS Playlist requests are currently supported.

    See more

    Declaration

    Swift

    @objc(BMPPreprocessHttpRequestDelegate)
    public protocol PreprocessHttpRequestDelegate
  • 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
  • Protocol for listeners for the OfflineManager.

    See more

    Declaration

    Swift

    @available(*, deprecated, message: "Use OfflineContentManagerListener instead")
    @objc(BMPOfflineManagerListener)
    public protocol OfflineManagerListener : 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