Skip to main content
Version: 20 Mar 2024

MLMediaPlayerEventCallbacksEx

Module: Media Player

Callbacks for notifying client about Media Player error events. More...

#include <ml_media_player.h>

Public Attributes

TypeName
uint32_tversion
void()(MLHandle media_player, const MLMediaPlayerOnBufferingUpdateInfo update_info)on_buffering_update
This callback function is invoked when buffered contents percentage changed.
void()(MLHandle media_player, const MLMediaPlayerOnCompletionInfo completion_info)on_completion
This callback is invoked when media player played back until end of media and has now come to a stop.
void()(MLHandle media_player, const MLMediaPlayerOnErrorInfo error_info)on_error
This callback function is invoked when media player encounters an error.
void()(MLHandle media_player, const MLMediaPlayerOnInfoInfo info)on_info
This callback function is invoked when Media Player generates informational events.
void()(MLHandle media_player, const MLMediaPlayerOnPreparedInfo prepared_info)on_prepared
This callback is invoked when the player has finished preparing media and is ready to playback.
void()(MLHandle media_player, const MLMediaPlayerOnSeekCompleteInfo seek_complete_info)on_seek_complete
This callback function is invoked when a seek operation has completed.
void()(MLHandle media_player, const MLMediaPlayerOnVideoSizeChangedInfo video_size_info)on_video_size_changed
This callback function is invoked when the internal surface has changed size.
void()(MLHandle media_player, const MLMediaPlayerOnTrackDRMInfo track_drm_info)on_track_drm_info
This callback function is invoked when source has DRM protected media track(s).
void()(MLHandle media_player, const MLMediaPlayerOnResetCompleteInfo reset_complete_info)on_reset_complete
This callback function is invoked when an async reset operation has completed.
void()(MLHandle media_player, const MLMediaPlayerOnFramePackingInfo frame_packing_info)on_frame_packing
This callback function is invoked when a stereoscopic video frame packing change.

Detailed Description

struct MLMediaPlayerEventCallbacksEx;

Callbacks for notifying client about Media Player error events.

Those are async mechanisms that should not be used in parallel with their sync counterpart, i.e. poll-based queries for the same events using MLMediaPlayerPollStatespoll().

Deprecated

Deprecated since 1.4.0. Scheduled for removal.

API Level:

  • 8

Public Attributes Documentation

version

uint32_t version;

on_buffering_update

void(*)(MLHandle media_player, const MLMediaPlayerOnBufferingUpdateInfo *update_info) on_buffering_update;

This callback function is invoked when buffered contents percentage changed.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnBufferingUpdateInfo update_info))(MLHandle media_player, const MLMediaPlayerOnBufferingUpdateInfo *update_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
update_infoPointer to MLMediaPlayerOnBufferingUpdateInfo.

on_completion

void(*)(MLHandle media_player, const MLMediaPlayerOnCompletionInfo *completion_info) on_completion;

This callback is invoked when media player played back until end of media and has now come to a stop.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnCompletionInfo completion_info))(MLHandle media_player, const MLMediaPlayerOnCompletionInfo *completion_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
completion_infoPointer to MLMediaPlayerOnCompletionInfo.

Note that this callback does not fire when 'looping = true', because Media Player does not "stop" in that case, but rather loops to beginning of media.

To get notified when EOS is reached (when looping = true), set a proper callback function for the below on_info and look for the #MEDIA_PLAYER_INFO_LOOPING info code.


on_error

void(*)(MLHandle media_player, const MLMediaPlayerOnErrorInfo *error_info) on_error;

This callback function is invoked when media player encounters an error.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnErrorInfo error_info))(MLHandle media_player, const MLMediaPlayerOnErrorInfo *error_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
erro_infoPointer to MLMediaPlayerOnErrorInfo.

on_info

void(*)(MLHandle media_player, const MLMediaPlayerOnInfoInfo *info) on_info;

This callback function is invoked when Media Player generates informational events.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnInfoInfo info))(MLHandle media_player, const MLMediaPlayerOnInfoInfo *info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
infoPointer to MLMediaPlayerOnInfoInfo.

on_prepared

void(*)(MLHandle media_player, const MLMediaPlayerOnPreparedInfo *prepared_info) on_prepared;

This callback is invoked when the player has finished preparing media and is ready to playback.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnPreparedInfo prepared_info))(MLHandle media_player, const MLMediaPlayerOnPreparedInfo *prepared_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
prepared_infoPointer to MLMediaPlayerOnPreparedInfo.

on_seek_complete

void(*)(MLHandle media_player, const MLMediaPlayerOnSeekCompleteInfo *seek_complete_info) on_seek_complete;

This callback function is invoked when a seek operation has completed.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnSeekCompleteInfo seek_complete_info))(MLHandle media_player, const MLMediaPlayerOnSeekCompleteInfo *seek_complete_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
seek_complete_infoPointer to MLMediaPlayerOnSeekCompleteInfo.

on_video_size_changed

void(*)(MLHandle media_player, const MLMediaPlayerOnVideoSizeChangedInfo *video_size_info) on_video_size_changed;

This callback function is invoked when the internal surface has changed size.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnVideoSizeChangedInfo video_size_info))(MLHandle media_player, const MLMediaPlayerOnVideoSizeChangedInfo *video_size_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
video_size_infoPointer to MLMediaPlayerOnVideoSizeChangedInfo.

on_track_drm_info

void(*)(MLHandle media_player, const MLMediaPlayerOnTrackDRMInfo *track_drm_info) on_track_drm_info;

This callback function is invoked when source has DRM protected media track(s).

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnTrackDRMInfo track_drm_info))(MLHandle media_player, const MLMediaPlayerOnTrackDRMInfo *track_drm_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
track_drm_infoPointer to MLMediaPlayerOnTrackDRMInfo.

on_reset_complete

void(*)(MLHandle media_player, const MLMediaPlayerOnResetCompleteInfo *reset_complete_info) on_reset_complete;

This callback function is invoked when an async reset operation has completed.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnResetCompleteInfo reset_complete_info))(MLHandle media_player, const MLMediaPlayerOnResetCompleteInfo *reset_complete_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
reset_complete_infopointer to MLMediaPlayerOnResetCompleteInfo.

on_frame_packing

void(*)(MLHandle media_player, const MLMediaPlayerOnFramePackingInfo *frame_packing_info) on_frame_packing;

This callback function is invoked when a stereoscopic video frame packing change.

TypeDescription
void()(MLHandle media_player, const MLMediaPlayerOnFramePackingInfo frame_packing_info))(MLHandle media_player, const MLMediaPlayerOnFramePackingInfo *frame_packing_info)

Parameters

media_playerMLHandle is a Media Player instance on which callback was set.
modeA MLMediaFramePackingMode.
flagsA MLMediaFramePackingFlags.