iOS SDK - Player events



Player events (iOS)

DMPlayerDelegate

Event

Description

player(_:openUrl:)

Informs the delegate that has to open a URL in a browser result as a user action.

player(_:didFailWithError:)

Sent when the player triggers an error.

playerDidStart(_:)

Sent the first time the player attempts to start the playback, either because of user interaction, an autoplay parameter or an API call (e.g. play(), loadContent(), etc.).

playerDidEnd(_:)

Sent when the playback of the content video, and eventual post-roll ad video is completed.

player(_:didChangeVideo:)

Sent when a new video has been loaded in the player. (e.g. after calling loadContent({ video: 'xID' }), or at player start-up).

player(_:didChangeVolume:_:)

Sent when the volume level or mute state changes.

player(_:didChangePlaybackSpeed speed: Double:)

Sent when the playback speed changes.

player(_:didReceivePlaybackPermission:)

Sent each time any playback request has failed or if the initial playback attempt has succeeded.

player(_:didChangePresentationMode:)

Sent when the player transitions to or from a Picture-in-Picture state, either native or the Dailymotion version, or when the player enters or exits the fullscreen state.

player(_:didChangeScaleMode:)

Sent when the scale mode of the player changes after using setScaleMode().

playerDidCriticalPathReady(_:)

Sent every time a video is ready to play, or started playing (depending on autoplay settings, and their resolution by the browser), or is unable to play (blocked, restricted, unavailable).

Video events (iOS)

DMVideoDelegate

Events

Description

video(_:didChangeSubtitles:)

Sent when the current subtitle changes.

video(_:didReceiveSubtitlesList:)

Sent when subtitles are available.

video(_:didChangeDuration:)

Sent when the duration property of the video becomes available or changes after a new video load.

videoDidEnd(_:)

Sent when the player completes playback of the content video.

videoDidPause(_:)

Sent when the video playback has paused.

videoDidPlay(_:)

Sent when the playback state of the content video is no longer paused, as a result of the play method or the autoplay attribute.

videoIsPlaying(_:)

Sent when the content video starts playing, after the play or waiting event.

video(_:isInProgress:)

Sent when the browser is fetching the media data.

video(_:didReceiveQualitiesList:)

Sent when video qualities are available.

video(_:didChangeQuality:)

Sent when the video quality changes.

video(_:didSeekEnd:)

Sent when the player has completed a seeking operation.

video(_:didSeekStart:)

Sent when the player starts to seek to another position in the video timeline.

videoDidStart(_:)

Sent when the player begins playback of the content video.

video(_:didChangeTime:)

Sent when the playback position changes.

videoIsBuffering(_:)

Sent when the player has to temporarily stop video playback for further buffering of content.

iOS Advertising events (iOS)

DMAdDelegate

Event

Description

adDidReceiveCompanions(_:)

Sent when a companion ad is received. Companion ads should be played in sync with the main ad (linear/non-linear) by listening to events ad(_:didStart:_:) and ad(_:didEnd:).

ad(_:didChangeDuration:)

Sent when the duration property of the video advertisement becomes available or changes after a new video load.

ad(_:didEnd:)

Sent when the player completes playback of an ad.

adDidPause(_:)

Sent when the player pauses an ad.

adDidPlay(_:)

Sent when the ad playback starts or continues after being in a paused state.

ad(_:didStart:_:)

Sent when the player begins playback of an ad video.

ad(_:didChangeTime:)

Sent when the playback position of an ad changes.

adDidImpression(_:)

Sent when the first ad frame is displayed.

ad(_:adDidLoaded:)

Sent when the player has loaded and buffered the creative’s media and assets either fully or to the extent that it is ready to play the media.

adDidClick(_:)

Sent when a user clicks on a video ad.

ad(_:adDidReadyToFetch:)

Sent a few seconds before an request is made:
– First preroll: 2 sec – Consecutive preroll: 4 sec – Midroll & postroll: 6 sec

Important: Only sent when Player setting enable_wait_for_custom_config
is true.