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
PlaylistTransitionevent is emitted and the newSourcebecomes active while the old one becomes inactive.Accessible through
See morePlayer.playlist.Declaration
Swift
@objc(BMPPlaylistApi) public protocol PlaylistApi -
API methods related to the user interface.
See moreDeclaration
Swift
@objc(BMPUserInterfaceApi) public protocol UserInterfaceApi : NSObjectProtocol -
Manages listeners to specific
See moreSourceEventand notifies those listeners when such an event is being emitted. Listeners need to conform to theSourceListenerprotocol. SeeSourceListenerabout possible event method implementations.Declaration
Swift
@objc(BMPSourceEventHandler) public protocol SourceEventHandler -
Handles adding and removing of event listeners.
See moreDeclaration
Swift
@objc(BMPUserInterfaceEventHandler) public protocol UserInterfaceEventHandler : NSObjectProtocol -
Declaration
Swift
@objc(BMPCueEvent) public protocol CueEvent -
Base protocol for all event classes.
See moreDeclaration
Swift
@objc(BMPEvent) public protocol Event : NSObjectProtocol -
Protocol for all
SourceEventclasses.Declaration
Swift
@objc(BMPSourceEvent) public protocol SourceEvent : Event -
Base protocol for all
PlayerViewEventclasses.Declaration
Swift
@objc(BMPPlayerViewEvent) public protocol PlayerViewEvent : Event -
Defines listener methods for all events available for the Player.
See moreDeclaration
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 moreDeclaration
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,SourceandPlayerViewentities, 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
LogEntryfor 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:
See moreDebugConfig.logging.logger = CustomLogger()Declaration
Swift
@objc(BMPLogger) public protocol Logger -
The
See moreImaAdsManagerprotocol can be used to interact with the underlying Google IMA SDK during ad playbackDeclaration
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 moreDeclaration
Swift
@objc(BMPPreprocessHttpRequestDelegate) public protocol PreprocessHttpRequestDelegate -
Enables external control over the associated BMPSubtitleTrack
See moreDeclaration
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 theSourceFactory.createfunction and will idle until it is loaded into a player. After loading the source into a player,isAttachedToPlayeristrueand 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 thePlaylistApi.The source starts out
LoadingState.unloaded, transitions toLoadingState.loadingonce the source starts loading and finally transitions toLoadingState.loadedwhen it finished loading. When unloaded from a player, the source reverts to beingLoadingState.unloadedand 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
SourceEventHandleron how to subscribe to events. The source only emits events of typeSourceEvent, and events that are emitted while the source is active are also emitted through the player it is attached to.Current event-related limitations
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
See moreSourceListenerfor more information about events emitted from the source.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 moreDeclaration
Swift
@objc(BMPOfflineContentManagerTweaksApi) public protocol OfflineContentManagerTweaksApi -
Protocol for listeners for the
See moreOfflineContentManager.Declaration
Swift
@objc(BMPOfflineContentManagerListener) public protocol OfflineContentManagerListener : NSObjectProtocol -
Protocol for delegate for the OfflineManager.
See moreDeclaration
Swift
@objc(BMPOfflineManagerDelegate) public protocol OfflineManagerDelegate : NSObjectProtocol -
Protocol for listeners for the OfflineManager.
See moreDeclaration
Swift
@available(*, deprecated, message: "Use OfflineContentManagerListener instead") @objc(BMPOfflineManagerListener) public protocol OfflineManagerListener : NSObjectProtocol -
See
See moreOfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPAvailableTracksFetchedEvent) public protocol AvailableTracksFetchedEvent : OfflineEvent -
See
OfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentDownloadCanceledEvent) public protocol ContentDownloadCanceledEvent : OfflineEvent -
See
OfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentDownloadFinishedEvent) public protocol ContentDownloadFinishedEvent : OfflineEvent -
See
See moreOfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentDownloadProgressChangedEvent) public protocol ContentDownloadProgressChangedEvent : OfflineEvent -
See
See moreOfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentDownloadResumedEvent) public protocol ContentDownloadResumedEvent : OfflineEvent -
See
OfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentDownloadSuspendedEvent) public protocol ContentDownloadSuspendedEvent : OfflineEvent -
See
See moreOfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPContentUrlMigrationFinishedEvent) public protocol ContentUrlMigrationFinishedEvent : OfflineEvent -
See
OfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPOfflineContentLicenseExpiredEvent) public protocol OfflineContentLicenseExpiredEvent : OfflineEvent -
See
OfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPOfflineContentLicenseRenewedEvent) public protocol OfflineContentLicenseRenewedEvent : OfflineEvent -
See
See moreOfflineContentManagerListenerfor more information on this event.Declaration
Swift
@objc(BMPOfflineErrorEvent) public protocol OfflineErrorEvent : OfflineEvent -
Protocol for all
OfflineEventclasses.Declaration
Swift
@objc(BMPOfflineEvent) public protocol OfflineEvent : Event -
A representation of a temporary break in participation.
See
See moreSharePlayApi.beginSuspension(for:)method for details on use.Declaration
Swift
@available(iOS 15.0, tvOS 15.0, *) @objc(BMPSharePlaySuspension) public protocol SharePlaySuspension -
The
See moreFullscreenHandlerimplementation can be set on aPlayerViewusing itsfullscreenHandlerproperty. TheFullscreenHandleracts as a delegate for handling the fullscreen related behaviour of the player view.Declaration
Swift
@objc(BMPFullscreenHandler) public protocol FullscreenHandler : NSObjectProtocol -
The
See moreSystemUiApifor interactions regarding the system UI. Using this API just has an effect ifuserInterfaceTypeinStyleConfigis set to.system. This is the default value on tvOS, on iOS it has to be set specifically.Declaration
Swift
@objc(BMPSystemUiApi) public protocol SystemUiApi -
Methods for handling received messages from Bitmovin Web UI.
See moreDeclaration
Swift
@objc(BMPCustomMessageHandlerDelegate) public protocol CustomMessageHandlerDelegate -
The
See morePictureInPictureApifor interactions regarding picture in picture feature.Declaration
Swift
@objc(BMPPictureInPictureApi) public protocol PictureInPictureApi
Protocols Reference