Protocols
The following protocols are available globally.
-
Defines basic properties available for every ad type
See moreDeclaration
Objective-C
@protocol BMPAd <NSObject, _BMPJsonEncodable>
Swift
protocol Ad : _JsonEncodable
-
Contains information about an ad break.
See moreDeclaration
Objective-C
@protocol BMPAdBreak <BMPAdConfig, _BMPJsonEncodable>
Swift
protocol AdBreak : AdConfig
-
Declaration
Objective-C
@protocol BMPAdBreakConfig <BMPAdTagConfig>
Swift
protocol AdBreakConfig : AdTagConfig
-
Contains the base config options for an ad.
See moreDeclaration
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.Declaration
Objective-C
@protocol BMPAdData <_BMPJsonEncodable>
Swift
protocol AdData : _JsonEncodable
-
Declaration
Objective-C
@protocol BMPAdTagConfig <BMPAdConfig>
Swift
protocol AdTagConfig : Sendable, AdConfig
-
Listener protocol which can be used to listen to events of the BMPBitmovinCastManager.
See moreDeclaration
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 moreDeclaration
Objective-C
@protocol BMPBufferApi <NSObject>
Swift
protocol BufferApi : NSObjectProtocol
-
Contains IMA specific information about an AdBreak.
See
BMPAdBreakDeclaration
Objective-C
@protocol BMPImaAdBreak <BMPAdBreak, BMPImaAdBreakConfig>
Swift
protocol ImaAdBreak : AdBreak, ImaAdBreakConfig
-
Contains IMA specific AdBreakConfig options.
See
BMPAdBreakConfigDeclaration
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 moreDeclaration
Objective-C
@protocol BMPImaAdData <BMPVastAdData>
Swift
protocol ImaAdData : VastAdData
-
Contains IMA specific AdTagConfig options.
Declaration
Objective-C
@protocol BMPImaAdTagConfig <BMPAdTagConfig>
Swift
protocol ImaAdTagConfig : AdTagConfig
-
Is linked to one
SourceConfig
and is used to manage offline content and offline DRM related tasks for this singleSourceConfig
.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 byofflineState
, 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 ofOfflineContentManagerListener
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 Declaration
Objective-C
@protocol BMPOfflineContentManager <NSObject, BMPOfflineContentManagerEventHandler>
Swift
protocol OfflineContentManager : Sendable, OfflineContentManagerEventHandler
-
Manages listeners to specific
See moreOfflineContentManager
s and notifies those listenersDeclaration
Objective-C
@protocol BMPOfflineContentManagerEventHandler <NSObject>
-
Defines an ad which gets displayed during content playback
-
Loads, controls and renders audio and video content represented through
Source
s. A player instance can be created via thePlayerFactory.create
function and will idle until one or moreSource
s 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 thePlaylistApi
.The player emits events during a player session. See
PlayerEventHandler
on how to subscribe to events.Event
s are divided intoPlayerEvent
andSourceEvent
, depending on if they are specific to a player session or a source. WhileSourceEvent
s 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 aPlayerEvent
.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
See morePlayerView
. ThePlayerView
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, anAVPlayerLayer
or anAVPlayerViewController
can be registered viaregisterPlayerLayer
/registerPlayerViewController
. SeePlayerView
for more details.Declaration
Objective-C
@protocol BMPPlayer <NSObject, BMPPlayerEventHandler, BMPRemoteControlApi>
Swift
protocol Player : Sendable, PlayerEventHandler, RemoteControlApi
-
Manages listeners to specific
See morePlayerEvent
s and notifies those listeners when such an event is being emitted. Listeners need to conform to thePlayerListener
protocol. SeePlayerListener
about possible event method implementations.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 moreDeclaration
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 moreDeclaration
Objective-C
@protocol BMPUserInterfaceListener <NSObject>
Swift
protocol UserInterfaceListener : NSObjectProtocol
-
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 newSource
becomes 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) @MainActor public protocol UserInterfaceApi : NSObjectProtocol
-
Manages listeners to specific
See moreSourceEvent
and notifies those listeners when such an event is being emitted. Listeners need to conform to theSourceListener
protocol. SeeSourceListener
about possible event method implementations.Declaration
Swift
@objc(BMPSourceEventHandler) public protocol SourceEventHandler
-
Handles adding and removing of event listeners.
See moreDeclaration
Swift
@MainActor @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, Sendable
-
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 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
,Source
andPlayerView
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:
See moreDebugConfig.logging.logger = CustomLogger()
Declaration
Swift
@objc(BMPLogger) public protocol Logger
-
The
See moreImaAdsManager
protocol can be used to interact with the underlying Google IMA SDK during ad playbackDeclaration
Swift
@objc(BMPImaAdsManager) public protocol ImaAdsManager : Sendable
-
A delegate protocol that can be used to change request parameters before a request is made.
- Example implementation of
PreprocessHttpRequestDelegate
.
See moreclass 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) } }
Declaration
Swift
@available(*, deprecated, message: "Use NetworkConfig.preprocessHttpRequest instead.") @objc(BMPPreprocessHttpRequestDelegate) public protocol PreprocessHttpRequestDelegate : Sendable
- Example implementation of
-
Represents a timeline marker that can be visualized in the player UI. It can represent a point in time or a time range.
See moreDeclaration
Swift
@objc(BMPTimelineMarker) public protocol TimelineMarker : Sendable
-
Enables external control over the associated BMPSubtitleTrack
See moreDeclaration
Swift
@objc(BMPSubtitleTrackController) public protocol SubtitleTrackController : NSObjectProtocol, Sendable
-
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.create
function and will idle until it is loaded into a player. After loading the source into a player,isAttachedToPlayer
istrue
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 thePlaylistApi
.The source starts out
LoadingState.unloaded
, transitions toLoadingState.loading
once the source starts loading and finally transitions toLoadingState.loaded
when it finished loading. When unloaded from a player, the source reverts to beingLoadingState.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 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 moreSourceListener
for more information about events emitted from the source.Declaration
Swift
@objc(BMPSource) public protocol Source : SourceEventHandler, Sendable
-
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
-
See
See moreOfflineContentManagerListener
for more information on this event.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
See moreOfflineContentManagerListener
for more information on this event.Declaration
Swift
@objc(BMPContentDownloadProgressChangedEvent) public protocol ContentDownloadProgressChangedEvent : OfflineEvent
-
See
See moreOfflineContentManagerListener
for more information on this event.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
See moreOfflineContentManagerListener
for more information on this event.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
See moreOfflineContentManagerListener
for more information on this event.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
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 moreFullscreenHandler
implementation can be set on aPlayerView
using itsfullscreenHandler
property. TheFullscreenHandler
acts as a delegate for handling the fullscreen related behaviour of the player view.Declaration
Swift
@MainActor @objc(BMPFullscreenHandler) public protocol FullscreenHandler : NSObjectProtocol
-
The
See moreSystemUiApi
for interactions regarding the system UI. Using this API just has an effect ifuserInterfaceType
inStyleConfig
is set to.system
. This is the default value on tvOS, on iOS it has to be set specifically.Declaration
Swift
@MainActor @objc(BMPSystemUiApi) public protocol SystemUiApi
-
Methods for handling received messages from Bitmovin Web UI.
See moreDeclaration
Swift
@objc(BMPCustomMessageHandlerDelegate) public protocol CustomMessageHandlerDelegate
-
The
See morePictureInPictureApi
for interactions regarding picture in picture feature.Declaration
Swift
@MainActor @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
See moreOfflineContentManager
. -
Protocol for delegate for the OfflineManager.
See more -
See
See moreOfflineContentManagerListener
for more information on this event. -
See
OfflineContentManagerListener
for more information on this event. -
See
OfflineContentManagerListener
for more information on this event. -
See
See moreOfflineContentManagerListener
for more information on this event. -
See
See moreOfflineContentManagerListener
for more information on this event. -
See
OfflineContentManagerListener
for more information on this event. -
See
See moreOfflineContentManagerListener
for more information on this event. -
See
OfflineContentManagerListener
for more information on this event. -
See
OfflineContentManagerListener
for more information on this event. -
See
See moreOfflineContentManagerListener
for more information on this event. -
Protocol for all
OfflineEvent
classes. -
Methods for handling received messages from Bitmovin Web UI.
See more -
Declaration
Swift
@objc(BPAAnalyticsSsaiApi) public protocol AnalyticsSsaiApi : Sendable
-
Provides an API to interact with the Analytics Collector of a
See morePlayer
Declaration
Swift
@objc(BPAPlayerAnalyticsApi) public protocol PlayerAnalyticsApi : Sendable