SourceListener
@objc(BMPSourceListener)
public protocol SourceListener : 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).
-
Called when the source duration has changed. Not emitted for the initial duration.
Declaration
Swift
@objc optional nonisolated func onDurationChanged(_ event: DurationChangedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the
Source
that started loading.Declaration
Swift
@objc optional nonisolated func onSourceLoad(_ event: SourceLoadEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a
Source
was loaded. This does not mean that the source is immediately ready for playback.Declaration
Swift
@objc optional nonisolated func onSourceLoaded(_ event: SourceLoadedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the
Source
started unloading.Declaration
Swift
@objc optional nonisolated func onSourceUnload(_ event: SourceUnloadEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a
Source
was unloaded.Declaration
Swift
@objc optional nonisolated func onSourceUnloaded(_ event: SourceUnloadedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a source warning occurred.
Declaration
Swift
@available(*, deprecated, message: "Warnings are now communicated through logs with level `.warning`. These logs are printed to the console by default. You can also access them by providing your own logger to `DebugConfig.logging.logger`\"") @objc optional nonisolated func onSourceWarning(_ event: SourceWarningEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a source error occurred.
Faulty
Source
s in a playlist can be removed from this event listener usingPlayer.playlist.remove(sourceAt:)
. Limitation: The activeSource
cannot be removed. Important: TheSource
has to be removed synchronously.Declaration
Swift
@objc optional nonisolated func onSourceError(_ event: SourceErrorEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when metadata is parsed.
Declaration
Swift
@objc optional nonisolated func onMetadataParsed(_ event: MetadataParsedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called for each occurring player event.
Declaration
Swift
@objc optional nonisolated func onEvent(_ event: SourceEvent, source: Source)
Parameters
event
An event object holding specific event data. Use
event.name
orevent is Type
to check the specific event type.source
The source instance which is associated with the emitted event.
-
Called when the drm data was parsed for the specific source.
Declaration
Swift
@objc optional nonisolated func onDrmDataParsed(_ event: DrmDataParsedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when an audio track is added.
Declaration
Swift
@objc optional nonisolated func onAudioAdded(_ event: AudioAddedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when an audio track is removed.
Declaration
Swift
@objc optional nonisolated func onAudioRemoved(_ event: AudioRemovedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the audio track is changed.
Declaration
Swift
@objc optional nonisolated func onAudioChanged(_ event: AudioChangedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a sideloaded subtitle cue has been parsed.
Declaration
Swift
@objc optional nonisolated func onCueParsed(_ event: CueParsedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when a new
SubtitleTrack
is added, for example using thePlayer.addSubtitle()
call.Declaration
Swift
@objc optional nonisolated func onSubtitleAdded(_ event: SubtitleAddedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when an external
SubtitleTrack
has been removed so it is possible to update the controls accordingly.Declaration
Swift
@objc optional nonisolated func onSubtitleRemoved(_ event: SubtitleRemovedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the active
SubtitleTrack
is changed.Declaration
Swift
@objc optional nonisolated func onSubtitleChanged(_ event: SubtitleChangedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the current video download quality has changed.
Declaration
Swift
@objc optional nonisolated func onVideoDownloadQualityChanged(_ event: VideoDownloadQualityChangedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when the current video playback quality has changed.
Declaration
Swift
@objc optional nonisolated func onVideoPlaybackQualityChanged(_ event: VideoPlaybackQualityChangedEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.
-
Called when FairPlay license was successfully acquired. The object held by property
contentKeyRequest
on the event can be used for renewing expiring licenses viaSource.drm.fairplay.renewExpiringLicense
APIDeclaration
Swift
@objc optional nonisolated func onFairplayLicenseAcquired(_ event: FairplayLicenseAcquiredEvent, source: Source)
Parameters
event
An object holding specific event data.
source
The source instance which is associated with the emitted event.