Enumeration MKPlayerEvent

MKPlayer event.

Enumeration Members

AdBreakFinished: "adbreakfinished"

Is fired when the ad break finishes.

The passed event is of type MKAdBreakFinishedEvent.

AdBreakStarted: "adbreakstarted"

Is fired each time the ad break playback starts.

The passed event is of type MKAdBreakStartedEvent.

AdClickThrough: "adclickthrough"

Is fired for every ad in the ad break which contains ad click through metadata.

The metadata contains details like ad clickThrough URL, the clickTracking URL.

The passed event is of type MKAdClickThroughEvent.

AdCompanion: "adcompanion"

Is fired for every ad in the ad break which contains companion ad metadata.

The metadata contains details of companion ad.

The passed event is of type MKAdCompanionEvent.

AdFinished: "adfinished"

Is fired when the ad within the ad break ends.

The passed event is of type MKAdFinishedEvent.

AdMarker: "admarker"

Is fired soon after the source is loaded and adbreaks are discovered in the source manifest.

One event for every ad break is triggered and the type of event data is MKTimeRange which contains the start and end of the ad break.

The passed event is of type MKAdMarkerEvent.

AdQuartile: "adquartile"

Is fired each time playback passes the quartile mark in the ad within the ad break.

The different quartiles are FirstQuartile | Midpoint | ThirdQuartile.

  • FirstQuartile is triggered at around 25% of ad playback
  • Midpoint is triggered at around 50% of ad playback
  • ThirdQuartile is triggered at around 75% of ad playback

The passed event is of type MKAdQuartileEvent.

AdStarted: "adstarted"

Is fired each time an ad in the ad break starts.

The passed event is of type MKAdStartedEvent.

AdVerification: "adverification"

Is fired for every ad in the ad break which contains ad verification metadata.

The metadata contains details to verify AD using libraries like OMSDK, etc.

The passed event is of type MKAdVerificationEvent.

AirplayAvailable: "airplayavailable"

Is fired when the airplay playback target turned available.

The passed event is of type MKPlayerEventBase.

AirplayChanged: "airplaychanged"

Is fired when a media element starts or stops AirPlay playback.

The passed event is of type MKAirplayChangedEvent.

AspectRatioChanged: "aspectratiochanged"

Is fired when the player's aspect ratio is changed, e.g. with a call to setAspectRatio.

The passed event is of type MKAspectRatioChangedEvent.

AudioAdaptation: "audioadaptation"

Is fired before a new audio segment is downloaded.

The passed event is of type MKAudioAdaptationEvent.

AudioAdded: "audioadded"

Is fired when a new audio track is added.

The passed event is of type MKAudioTrackEvent.

AudioChanged: "audiochanged"

Is fired when the audio track is changed.

It is also fired when a newly added track becomes enabled after the SourceLoaded event.

In this case and if no other track was enabled before, the sourceAudio property will be set to null.

The passed event is of type MKAudioChangedEvent.

AudioDownloadQualityChange: "audiodownloadqualitychange"

Is fired when changing the downloaded audio quality is triggered, either by using setAudioQuality or due to automatic dynamic adaptation.

The passed event is of type MKAudioDownloadQualityChangeEvent.

AudioDownloadQualityChanged: "audiodownloadqualitychanged"

Is fired when the downloaded audio quality has been changed successfully.

It is (not necessarily directly) preceded by an MKAudioDownloadQualityChangeEvent event.

The passed event is of type MKAudioDownloadQualityChangedEvent.

AudioPlaybackQualityChanged: "audioplaybackqualitychanged"

Is fired when the played audio quality changed.

The passed event is of type MKAudioPlaybackQualityChangedEvent.

AudioQualityAdded: "audioqualityadded"

Is fired when one ore more audio representations have been added to the stream.

The passed event is of type MKAudioQualityEvent.

AudioQualityChanged: "audioqualitychanged"

Is fired when changing the audio quality is triggered by using setAudioQuality.

The passed event is of type MKAudioQualityChangedEvent.

AudioQualityRemoved: "audioqualityremoved"

Is fired when one ore more audio representations have been removed from the stream.

The passed event is of type MKAudioQualityEvent.

AudioRemoved: "audioremoved"

Is fired when an existing audio track is removed.

The passed event is of type MKAudioTrackEvent.

CastAvailable: "castavailable"

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

The passed event is of type MKCastAvailableEvent.

CastStart: "caststart"

Is fired when the casting has been initiated, but the user still needs to choose which device should be used.

The passed event is of type MKPlayerEventBase.

CastStarted: "caststarted"

Is fired when the Cast app is either launched successfully or an active Cast session is resumed successfully.

The passed event is of type MKCastStartedEvent.

CastStopped: "caststopped"

Is fired when the casting is stopped.

The passed event is of type MKPlayerEventBase.

CastWaitingForDevice: "castwaitingfordevice"

Is fired when the user has chosen a cast device and the player is waiting for the device to get ready for playback.

The passed event is of type MKCastWaitingForDeviceEvent.

CueEnter: "cueenter"

Is fired when a subtitle entry transitions into the active status.

The passed event is of type MKSubtitleCueEvent.

CueExit: "cueexit"

Is fired when an active subtitle entry transitions into the inactive status.

The passed event is of type MKSubtitleCueEvent.

CueParsed: "cueparsed"

Is fired when a subtitle is parsed from a stream, manifest or subtitle file.

The passed event is of type MKSubtitleCueEvent.

CueUpdate: "cueupdate"

Is fired when either the start time, end time, or content of a cue changes.

The passed event is of type MKSubtitleCueEvent.

For example, it is fired when a WebVTT cue contains timestamp tags:

00:00:00.000 --> 00:00:05.000
Welcome to the<00:00:02.000> MKPlayer!

This would result in the following events:

  • t = 0: CueEnter:
{
start: 0,
end: 5,
html: '<span>Welcome to the<span class="cue-future" style="visibility:hidden;"> MKPlayer!</span></span>',
(...)
}
  • t = 2: CueUpdate:
{
start: 0,
end: 5,
html: '<span>Welcome to the<span class="cue-future" style="visibility:hidden;"> MKPlayer!</span></span>',
(...)
}
  • t = 5: CueExit

Note: The text property does not change and always contains the full text content of the cue.

DVRWindowExceeded: "dvrwindowexceeded"

Is fired if the player is paused or in buffering state and the timeShift offset has exceeded the available timeShift window.

The passed event is of type MKPlayerEventBase.

Destroy: "destroy"

Is fired when the player instance is destroyed.

The passed event is of type MKPlayerEventBase.

DownloadFinished: "downloadfinished"

Is fired immediately after a download finishes successfully, or if all retries of a download failed.

The passed event is of type MKDownloadFinishedEvent.

DrmLicenseAdded: "drmlicenseadded"

Is fired after a DRM license request has finished and the returned license has been added to the key session.

The passed event is of type MKDrmLicenseAddedEvent.

DurationChanged: "durationchanged"

Is fired when the duration of a source changes.

Is not fired for the initial duration of a source.

The passed event is of type MKDurationChangedEvent.

Error: "mkerror"

Is fired when an error is encountered during setup (e.g. HTML5/JS cannot be used) or during playback.

The passed event is of type MKErrorEvent.

FMTSASiD: "fmtsasid"

Is fired when data required for FMTS Watermarking becomes available.

This is fired only for MKRegisteredSource content.

The passed event is of type MKFMTSASiDEvent.

LatencyModeChanged: "latencymodechanged"

Is fired when the mode of the latency control mechanism changes.

The passed event is of type MKLatencyModeChangedEvent.

Metadata: "metadata"

Is fired after metadata (i.e. ID3 tags in HLS and EMSG in DASH) is parsed and when currentTime progresses to a point beyond the start of the metadata event.

The passed event is of type MKMetadataEvent.

MetadataChanged: "metadatachanged"

Is fired when DateRange metadata content changes while the metadata is active.

The passed event is of type MKMetadataChangedEvent.

MetadataParsed: "metadataparsed"

Is fired as soon as metadata (i.e. ID3 tags in HLS and EMSG in DASH) is parsed.

The passed event is of type MKMetadataParsedEvent.

Muted: "muted"

Is fired when the player is muted.

The passed event is of type MKUserInteractionEvent.

Paused: "paused"

Is fired when the player enters the pause state.

The passed event is of type MKPlaybackEvent.

PeriodSwitch: "periodswitch"

Is fired when a period switch starts.

The passed event is of type MKPlayerEventBase.

PeriodSwitched: "periodswitched"

Is fired when a period switch was performed.

The passed event is of type MKPeriodSwitchedEvent.

Play: "play"

Is fired when the player enters the play state.

It is only triggered through a public API call or interaction with the video element.

Using the autoplay does not trigger this event.

The passed event is of type MKPlaybackEvent.

PlaybackFinished: "playbackfinished"

Is fired when the playback of the current video has finished.

The passed event is of type MKPlayerEventBase.

PlaybackSpeedChanged: "playbackspeedchanged"

Is fired when the playback speed is changed.

The passed event is of type MKPlaybackSpeedChangedEvent.

PlayerResized: "playerresized"

Is fired when the player size is updated.

The passed event is of type MKPlayerResizedEvent.

Playing: "playing"

Is fired when the player actually has started playback.

The passed event is of type MKPlaybackEvent.

ProgramRestrictions: "programrestrictions"

Is fired when program restrictions are applicable for the currently selected source.

Typically these restictions are control blocking in nature, meaning playback is not stopped but only indicates which controls are blocked (Ex: Fast-forward, Rewind, Seek/Scrubbing etc.)

The pass event is of type MKProgramRestrictionsEvent.

ProgramTimeChanged: "programtimechanged"

Is only fired for a 24x7 live source if current program time range is found in the metadata.

The event data contains the current airing programs start and end time as MKTimeRange.

The passed event is of type MKProgramTimeChangedEvent.

Ready: "ready"

Is fired when the player has enough data to start playback.

The passed event is of type MKPlayerEventBase.

Seek: "seek"

Is fired periodically during seeking. Only applies to VoD streams, please refer to TimeShift for live.

The passed event is of type MKSeekEvent.

It is only triggered through a public API call.

Using the startOffset does not trigger this event.

Seeked: "seeked"

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

The passed event is of type MKPlayerEventBase.

It is only triggered through a public API call.

Using the startOffset does not trigger this event.

SegmentPlayback: "segmentplayback"

Is fired when a segment is played back.

The passed event is of type MKSegmentPlaybackEvent.

SegmentRequestFinished: "segmentrequestfinished"

Is fired when a segment download has been finished, whether successful or not.

The passed event is of type MKSegmentRequestFinishedEvent.

ShowAirplayTargetPicker: "showairplaytargetpicker"

Is fired when the airplay playback target picker is shown.

The passed event is of type MKPlayerEventBase.

SourceLoad: "sourceload"

Is fired when a new source load has been initiated.

The passed event is of type MKPlayerEventBase.

SourceLoaded: "sourceloaded"

Is fired when a new source has finished loading.

The passed event is of type MKPlayerEventBase.

SourceUnload: "sourceunload"

Is fired when the current source unload has been initiated.

The passed event is of type MKPlayerEventBase.

SourceUnloaded: "sourceunloaded"

Is fired when the current source has been unloaded.

The passed event is of type MKPlayerEventBase.

StallEnded: "stallended"

Is fired when the player ends stalling due to enough data in the buffer.

The passed event is of type MKPlayerEventBase.

StallStarted: "stallstarted"

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

The passed event is of type MKPlayerEventBase.

SubtitleAdded: "subtitleadded"

Is fired when a new subtitles/captions track is added, for example using add API call or when in-stream closed captions are encountered.

The passed event is of type MKSubtitleEvent.

SubtitleDisable: "subtitledisable"

Is fired when a subtitle is being disabled.

The passed event is of type MKSubtitleEvent.

SubtitleDisabled: "subtitledisabled"

Is fired when a subtitle got disabled.

The passed event is of type MKSubtitleEvent.

SubtitleEnable: "subtitleenable"

Is fired when a subtitle is being enabled.

The passed event is of type MKSubtitleEvent.

SubtitleEnabled: "subtitleenabled"

Is fired when a subtitle got enabled.

The passed event is of type MKSubtitleEvent.

SubtitleRemoved: "subtitleremoved"

Is fired when an external subtitle file has been removed so it is possible to update the controls accordingly.

The passed event is of type MKSubtitleEvent.

TargetLatencyChanged: "targetlatencychanged"

Is fired when the target latency for playback of a live stream changes.

The passed event is of type MKTargetLatencyChangedEvent.

TimeChanged: "timechanged"

Is fired when the current playback time has changed.

The passed event is of type MKPlaybackEvent.

Unmuted: "unmuted"

Is fired when the player is unmuted.

The passed event is of type MKUserInteractionEvent.

VSPPSessionIdAvailable: "vsppsessionidavailable"

Is fired only when source stream is from VSPP and when VSPP session ID is detected in the source manifest.

The passed event is of type MKVSPPSessionIdEvent.

VideoAdaptation: "videoadaptation"

Is fired before a new video segment is downloaded.

The passed event is of type MKVideoAdaptationEvent.

VideoDownloadQualityChange: "videodownloadqualitychange"

Is fired when changing the downloaded video quality is triggered, either by using setVideoQuality or due to automatic dynamic adaptation.

The passed event is of type MKVideoDownloadQualityChangeEvent.

VideoDownloadQualityChanged: "videodownloadqualitychanged"

Is fired when the downloaded video quality has been changed successfully.

It is (not necessarily directly) preceded by an VideoDownloadQualityChange event.

The passed event is of type MKVideoDownloadQualityChangedEvent.

VideoPlaybackQualityChanged: "videoplaybackqualitychanged"

Is fired when the displayed video quality changed.

The passed event is of type MKVideoPlaybackQualityChangedEvent.

VideoQualityAdded: "videoqualityadded"

Is fired when one ore more video representations have been added to the stream.

The passed event is of type MKVideoQualityEvent.

VideoQualityChanged: "videoqualitychanged"

Is fired when changing the video quality is triggered by using setVideoQuality.

The passed event is of type MKVideoQualityChangedEvent.

VideoQualityRemoved: "videoqualityremoved"

Is fired when one ore more video representations have been removed from the stream.

The passed event is of type MKVideoQualityEvent.

ViewModeChanged: "viewmodechanged"

Is fired when the player's ViewMode is changed, e.g. with a call to setViewMode.

The passed event is of type MKViewModeChangedEvent.

VolumeChanged: "volumechanged"

Is fired when the volume is changed.

The passed event is of type MKVolumeChangedEvent.