BMPPlayerListener

Objective-C

@protocol BMPPlayerListener <NSObject>

Swift

protocol PlayerListener : NSObjectProtocol

Defines listener methods for all events available for the BitmovinPlayer. See the documentation of the single listener methods for further information.

  • Is called when the player is ready for immediate playback, because initial audio/video has been downloaded.

    Declaration

    Objective-C

    - (void)onReady:(nonnull BMPReadyEvent *)event;

    Swift

    optional func onReady(_ event: BMPReadyEvent)

    Parameters

    event

    An object holding specific event data.

  • Notifies about the intention to start/resume playback.

    Declaration

    Objective-C

    - (void)onPlay:(nonnull BMPPlayEvent *)event;

    Swift

    optional func onPlay(_ event: BMPPlayEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when playback has been started.

    Declaration

    Objective-C

    - (void)onPlaying:(nonnull BMPPlayingEvent *)event;

    Swift

    optional func onPlaying(_ event: PlayingEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player enters the pause state.

    Declaration

    Objective-C

    - (void)onPaused:(nonnull BMPPausedEvent *)event;

    Swift

    optional func onPaused(_ event: PausedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the current playback time has changed.

    Declaration

    Objective-C

    - (void)onTimeChanged:(nonnull BMPTimeChangedEvent *)event;

    Swift

    optional func onTimeChanged(_ event: TimeChangedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the duration of the current played media has changed.

    Declaration

    Objective-C

    - (void)onDurationChanged:(nonnull BMPDurationChangedEvent *)event;

    Swift

    optional func onDurationChanged(_ event: BMPDurationChangedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called periodically during seeking.

    Only applies to VoD streams.

    Declaration

    Objective-C

    - (void)onSeek:(nonnull BMPSeekEvent *)event;

    Swift

    optional func onSeek(_ event: BMPSeekEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when seeking has been finished and data is available to continue playback.

    Only applies to VoD streams.

    Declaration

    Objective-C

    - (void)onSeeked:(nonnull BMPSeekedEvent *)event;

    Swift

    optional func onSeeked(_ event: BMPSeekedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called periodically during time shifting. Only applies to live streams, please refer to onSeek for VoD streams.

    Declaration

    Objective-C

    - (void)onTimeShift:(nonnull BMPTimeShiftEvent *)event;

    Swift

    optional func onTimeShift(_ event: BMPTimeShiftEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when time shifting has been finished and data is available to continue playback. Only applies to live streams, please refer to onSeeked for VoD streams.

    Declaration

    Objective-C

    - (void)onTimeShifted:(nonnull BMPTimeShiftedEvent *)event;

    Swift

    optional func onTimeShifted(_ event: BMPTimeShiftedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player is paused or in buffering state and the timeShift offset has exceeded the available timeShift window.

    Declaration

    Objective-C

    - (void)onDvrWindowExceeded:(nonnull BMPDvrWindowExceededEvent *)event;

    Swift

    optional func onDvrWindowExceeded(_ event: DvrWindowExceededEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player begins to stall and to buffer due to an empty buffer.

    Declaration

    Objective-C

    - (void)onStallStarted:(nonnull BMPStallStartedEvent *)event;

    Swift

    optional func onStallStarted(_ event: StallStartedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player ends stalling, due to enough data in the buffer.

    Declaration

    Objective-C

    - (void)onStallEnded:(nonnull BMPStallEndedEvent *)event;

    Swift

    optional func onStallEnded(_ event: StallEndedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the current size of the video content has been changed.

    Declaration

    Objective-C

    - (void)onVideoSizeChanged:(nonnull BMPVideoSizeChangedEvent *)event;

    Swift

    optional func onVideoSizeChanged(_ event: VideoSizeChangedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the playback of the current media has finished.

    Declaration

    Objective-C

    - (void)onPlaybackFinished:(nonnull BMPPlaybackFinishedEvent *)event;

    Swift

    optional func onPlaybackFinished(_ event: BMPPlaybackFinishedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the first frame of the current video is rendered onto the video surface.

    Declaration

    Objective-C

    - (void)onRenderFirstFrame:(nonnull BMPRenderFirstFrameEvent *)event;

    Swift

    optional func onRenderFirstFrame(_ event: RenderFirstFrameEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when an error is encountered.

    Declaration

    Objective-C

    - (void)onError:(nonnull BMPErrorEvent *)event;

    Swift

    optional func onError(_ event: BMPErrorEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when a warning occurs.

    Declaration

    Objective-C

    - (void)onWarning:(nonnull BMPWarningEvent *)event;

    Swift

    optional func onWarning(_ event: WarningEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when a new source is loaded. This does not mean that loading of the new manifest has been finished.

    Declaration

    Objective-C

    - (void)onSourceLoaded:(nonnull BMPSourceLoadedEvent *)event;

    Swift

    optional func onSourceLoaded(_ event: BMPSourceLoadedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the current source will be unloaded.

    Declaration

    Objective-C

    - (void)onSourceWillUnload:(nonnull BMPSourceWillUnloadEvent *)event;

    Swift

    optional func onSourceWillUnload(_ event: BMPSourceWillUnloadEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the current source has been unloaded.

    Declaration

    Objective-C

    - (void)onSourceUnloaded:(nonnull BMPSourceUnloadedEvent *)event;

    Swift

    optional func onSourceUnloaded(_ event: BMPSourceUnloadedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player was destroyed.

    Declaration

    Objective-C

    - (void)onDestroy:(nonnull BMPDestroyEvent *)event;

    Swift

    optional func onDestroy(_ event: BMPDestroyEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when metadata (i.e. ID3 tags in HLS and EMSG in DASH) are encountered.

    Declaration

    Objective-C

    - (void)onMetadata:(nonnull BMPMetadataEvent *)event;

    Swift

    optional func onMetadata(_ event: MetadataEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when metadata is parsed.

    Declaration

    Objective-C

    - (void)onMetadataParsed:(nonnull BMPMetadataParsedEvent *)event;

    Swift

    optional func onMetadataParsed(_ event: MetadataParsedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when casting to another device, such as a ChromeCast, is available.

    Declaration

    Objective-C

    - (void)onCastAvailable:(nonnull BMPCastAvailableEvent *)event;

    Swift

    optional func onCastAvailable(_ event: CastAvailableEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the playback on an cast device has been paused.

    Declaration

    Objective-C

    - (void)onCastPaused:(nonnull BMPCastPausedEvent *)event;

    Swift

    optional func onCastPaused(_ event: CastPausedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the playback on an cast device has been finished.

    Declaration

    Objective-C

    - (void)onCastPlaybackFinished:(nonnull BMPCastPlaybackFinishedEvent *)event;

    Swift

    optional func onCastPlaybackFinished(_ event: CastPlaybackFinishedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when playback on an cast device has been started.

    Declaration

    Objective-C

    - (void)onCastPlaying:(nonnull BMPCastPlayingEvent *)event;

    Swift

    optional func onCastPlaying(_ event: CastPlayingEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the cast app is launched successfully.

    Declaration

    Objective-C

    - (void)onCastStarted:(nonnull BMPCastStartedEvent *)event;

    Swift

    optional func onCastStarted(_ event: CastStartedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when casting is initiated, but the user still needs to choose which device should be used.

    Declaration

    Objective-C

    - (void)onCastStart:(nonnull BMPCastStartEvent *)event;

    Swift

    optional func onCastStart(_ event: CastStartEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when casting to a device is stopped.

    Declaration

    Objective-C

    - (void)onCastStopped:(nonnull BMPCastStoppedEvent *)event;

    Swift

    optional func onCastStopped(_ event: CastStoppedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the time update from the currently used cast device is received.

    Declaration

    Objective-C

    - (void)onCastTimeUpdated:(nonnull BMPCastTimeUpdatedEvent *)event;

    Swift

    optional func onCastTimeUpdated(_ event: CastTimeUpdatedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when a cast device has been chosen and player is waiting for the device to get ready for playback.

    Declaration

    Objective-C

    - (void)onCastWaitingForDevice:(nonnull BMPCastWaitingForDeviceEvent *)event;

    Swift

    optional func onCastWaiting(forDevice event: CastWaitingForDeviceEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when the player configuration has been updated by either calling load or setup on the player.

    Declaration

    Objective-C

    - (void)onConfigurationUpdated:(nonnull BMPConfigurationUpdatedEvent *)event;

    Swift

    optional func onConfigurationUpdated(_ event: ConfigurationUpdatedEvent)

    Parameters

    event

    An object holding specific event data.

  • Is called when a sideloaded subtitle cue has been parsed.

    Declaration

    Objective-C

    - (void)onCueParsed:(nonnull BMPCueParsedEvent *)event;

    Swift

    optional func onCueParsed(_ event: CueParsedEvent)
  • Is called when a subtitle entry transitions into the active status.

    Declaration

    Objective-C

    - (void)onCueEnter:(nonnull BMPCueEnterEvent *)event;

    Swift

    optional func onCueEnter(_ event: CueEnterEvent)
  • Is called when an active subtitle entry transitions into the inactive status.

    Declaration

    Objective-C

    - (void)onCueExit:(nonnull BMPCueExitEvent *)event;

    Swift

    optional func onCueExit(_ event: CueExitEvent)
  • Is called when a new BMPSubtitleTrack is added, for example using the BMPPlayerAPI#addSubtitle: call.

    Declaration

    Objective-C

    - (void)onSubtitleAdded:(nonnull BMPSubtitleAddedEvent *)event;

    Swift

    optional func onSubtitleAdded(_ event: SubtitleAddedEvent)
  • Is called when an external BMPSubtitleTrack has been removed so it is possible to update the controls accordingly.

    Declaration

    Objective-C

    - (void)onSubtitleRemoved:(nonnull BMPSubtitleRemovedEvent *)event;

    Swift

    optional func onSubtitleRemoved(_ event: SubtitleRemovedEvent)
  • Is called when the active BMPSubtitleTrack is changed.

    Declaration

    Objective-C

    - (void)onSubtitleChanged:(nonnull BMPSubtitleChangedEvent *)event;

    Swift

    optional func onSubtitleChanged(_ event: SubtitleChangedEvent)
  • Is called when the player is muted.

    Declaration

    Objective-C

    - (void)onMuted:(nonnull BMPMutedEvent *)event;

    Swift

    optional func onMuted(_ event: MutedEvent)
  • Is called when the player is unmuted.

    Declaration

    Objective-C

    - (void)onUnmuted:(nonnull BMPUnmutedEvent *)event;

    Swift

    optional func onUnmuted(_ event: UnmutedEvent)
  • Is called when an audio track is added.

    Declaration

    Objective-C

    - (void)onAudioAdded:(nonnull BMPAudioAddedEvent *)event;

    Swift

    optional func onAudioAdded(_ event: BMPAudioAddedEvent)
  • Is called when an audio track is removed.

    Declaration

    Objective-C

    - (void)onAudioRemoved:(nonnull BMPAudioRemovedEvent *)event;

    Swift

    optional func onAudioRemoved(_ event: AudioRemovedEvent)
  • Is called when the audio track is changed.

    Declaration

    Objective-C

    - (void)onAudioChanged:(nonnull BMPAudioChangedEvent *)event;

    Swift

    optional func onAudioChanged(_ event: AudioChangedEvent)
  • Is called when the playback of an ad has been started.

    Declaration

    Objective-C

    - (void)onAdStarted:(nonnull BMPAdStartedEvent *)event;

    Swift

    optional func onAdStarted(_ event: BMPAdStartedEvent)
  • Is called when the playback of an ad has been finished.

    Declaration

    Objective-C

    - (void)onAdFinished:(nonnull BMPAdFinishedEvent *)event;

    Swift

    optional func onAdFinished(_ event: BMPAdFinishedEvent)
  • Is fired when the playback of an ad has progressed over a quartile boundary.

    Declaration

    Objective-C

    - (void)onAdQuartile:(nonnull BMPAdQuartileEvent *)event;

    Swift

    optional func onAdQuartile(_ event: AdQuartileEvent)
  • Is called when the playback of an ad break has been started

    Declaration

    Objective-C

    - (void)onAdBreakStarted:(nonnull BMPAdBreakStartedEvent *)event;

    Swift

    optional func onAdBreakStarted(_ event: BMPAdBreakStartedEvent)
  • Is called when the playback of an ad break has been finished.

    Declaration

    Objective-C

    - (void)onAdBreakFinished:(nonnull BMPAdBreakFinishedEvent *)event;

    Swift

    optional func onAdBreakFinished(_ event: BMPAdBreakFinishedEvent)
  • Is called when an ad manifest was successfully downloaded and parsed and the ad has been added onto the queue.

    Declaration

    Objective-C

    - (void)onAdScheduled:(nonnull BMPAdScheduledEvent *)event;

    Swift

    optional func onAdScheduled(_ event: AdScheduledEvent)
  • Is called when an ad has been skipped.

    Declaration

    Objective-C

    - (void)onAdSkipped:(nonnull BMPAdSkippedEvent *)event;

    Swift

    optional func onAdSkipped(_ event: BMPAdSkippedEvent)
  • Is called when the user clicks on the ad.

    Declaration

    Objective-C

    - (void)onAdClicked:(nonnull BMPAdClickedEvent *)event;

    Swift

    optional func onAdClicked(_ event: BMPAdClickedEvent)
  • Is called when ad playback fails.

    Declaration

    Objective-C

    - (void)onAdError:(nonnull BMPAdErrorEvent *)event;

    Swift

    optional func onAdError(_ event: BMPAdErrorEvent)
  • Is called when the download of an ad manifest is starting

    Declaration

    Objective-C

    - (void)onAdManifestLoad:(nonnull BMPAdManifestLoadEvent *)event;

    Swift

    optional func onAdManifestLoad(_ event: BMPAdManifestLoadEvent)
  • Is called when the ad manifest has been successfully loaded.

    Declaration

    Objective-C

    - (void)onAdManifestLoaded:(nonnull BMPAdManifestLoadedEvent *)event;

    Swift

    optional func onAdManifestLoaded(_ event: BMPAdManifestLoadedEvent)
  • Is called when the current video download quality has changed.

    Declaration

    Objective-C

    - (void)onVideoDownloadQualityChanged:
        (nonnull BMPVideoDownloadQualityChangedEvent *)event;

    Swift

    optional func onVideoDownloadQualityChanged(_ event: VideoDownloadQualityChangedEvent)
  • Is called when a web download request has finished.

    Declaration

    Objective-C

    - (void)onDownloadFinished:(nonnull BMPDownloadFinishedEvent *)event;

    Swift

    optional func onDownloadFinished(_ event: BMPDownloadFinishedEvent)
  • Is called when AirPlay playback starts or stops.

    Declaration

    Objective-C

    - (void)onAirPlayChanged:(nonnull BMPAirPlayChangedEvent *)event;

    Swift

    optional func onAirPlayChanged(_ event: AirPlayChangedEvent)
  • Is called when AirPlay is available.

    Declaration

    Objective-C

    - (void)onAirPlayAvailable:(nonnull BMPAirPlayAvailableEvent *)event;

    Swift

    optional func onAirPlayAvailable(_ event: AirPlayAvailableEvent)
  • Is called when a source item is loaded which has metadata attached or when setSourceMetadata: is called on the player.

    Declaration

    Objective-C

    - (void)onSourceMetadataChanged:(nonnull BMPSourceMetadataChangedEvent *)event;

    Swift

    optional func onSourceMetadataChanged(_ event: SourceMetadataChangedEvent)
  • Is called when DRM data is found in a downloaded manifest file. TweaksConfiguration.nativeHlsParsingEnabled needs to be set to true to receive those events.

    Declaration

    Objective-C

    - (void)onDrmDataParsed:(nonnull BMPDrmDataParsedEvent *)event;

    Swift

    optional func onDrmDataParsed(_ event: BMPDrmDataParsedEvent)
  • Is called for each occurring player event.

    Declaration

    Objective-C

    - (void)onEvent:(nonnull BMPPlayerEvent *)event;

    Swift

    optional func onEvent(_ event: PlayerEvent)

    Parameters

    event

    The player event. Use event.name or [event isKindOfClass:] to check the specific event type.