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 func onDurationChanged(_ event: DurationChangedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the
Sourcethat started loading.Declaration
Swift
@objc optional func onSourceLoad(_ event: SourceLoadEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when a
Sourcewas loaded. This does not mean that the source is immediately ready for playback.Declaration
Swift
@objc optional func onSourceLoaded(_ event: SourceLoadedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the
Sourcestarted unloading.Declaration
Swift
@objc optional func onSourceUnload(_ event: SourceUnloadEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when a
Sourcewas unloaded.Declaration
Swift
@objc optional func onSourceUnloaded(_ event: SourceUnloadedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe 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 func onSourceWarning(_ event: SourceWarningEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when a source error occurred.
Faulty
Sources in a playlist can be removed from this event listener usingPlayer.playlist.remove(sourceAt:). Limitation: The activeSourcecannot be removed. Important: TheSourcehas to be removed synchronously.Declaration
Swift
@objc optional func onSourceError(_ event: SourceErrorEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when metadata is parsed.
Declaration
Swift
@objc optional func onMetadataParsed(_ event: MetadataParsedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called for each occurring player event.
Declaration
Swift
@objc optional func onEvent(_ event: SourceEvent, source: Source)Parameters
eventAn event object holding specific event data. Use
event.nameorevent is Typeto check the specific event type.sourceThe source instance which is associated with the emitted event.
-
Called when the drm data was parsed for the specific source.
Declaration
Swift
@objc optional func onDrmDataParsed(_ event: DrmDataParsedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when an audio track is added.
Declaration
Swift
@objc optional func onAudioAdded(_ event: AudioAddedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when an audio track is removed.
Declaration
Swift
@objc optional func onAudioRemoved(_ event: AudioRemovedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the audio track is changed.
Declaration
Swift
@objc optional func onAudioChanged(_ event: AudioChangedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when a sideloaded subtitle cue has been parsed.
Declaration
Swift
@objc optional func onCueParsed(_ event: CueParsedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when a new
SubtitleTrackis added, for example using thePlayer.addSubtitle()call.Declaration
Swift
@objc optional func onSubtitleAdded(_ event: SubtitleAddedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when an external
SubtitleTrackhas been removed so it is possible to update the controls accordingly.Declaration
Swift
@objc optional func onSubtitleRemoved(_ event: SubtitleRemovedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the active
SubtitleTrackis changed.Declaration
Swift
@objc optional func onSubtitleChanged(_ event: SubtitleChangedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the current video download quality has changed.
Declaration
Swift
@objc optional func onVideoDownloadQualityChanged(_ event: VideoDownloadQualityChangedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when the current video playback quality has changed.
Declaration
Swift
@objc optional func onVideoPlaybackQualityChanged(_ event: VideoPlaybackQualityChangedEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
-
Called when FairPlay license was successfully acquired. The object held by property
contentKeyRequeston the event can be used for renewing expiring licenses viaSource.drm.fairplay.renewExpiringLicenseAPIDeclaration
Swift
@objc optional func onFairplayLicenseAcquired(_ event: FairplayLicenseAcquiredEvent, source: Source)Parameters
eventAn object holding specific event data.
sourceThe source instance which is associated with the emitted event.
SourceListener Protocol Reference