Tizen Native API  4.0
Player

The Player API provides functions for media playback and controlling media playback attributes.

Required Header

#include <player.h>

Overview

The Player API provides a way to play multimedia content. Content can be played from a file, from the network, or from memory. It gives the ability to start/stop/pause/mute, set the playback position (that is, seek), perform various status queries, and control the display.

Additional functions allow registering notifications via callback functions for various state change events.

This API also enables collaboration with the GUI service to present a video.

State Diagram

Playback of multimedia content is controlled by a state machine. The following diagram shows the life cycle and states of the Player.

capi_media_player_state_diagram.png

State Transitions

FUNCTION PRE-STATE POST-STATE SYNC TYPE
player_create() NONE IDLE SYNC
player_destroy() IDLE NONE SYNC
player_prepare() IDLE READY SYNC
player_prepare_async() IDLE READY ASYNC
player_unprepare() READY, PLAYING or PAUSED IDLE SYNC
player_start() READY or PAUSED PLAYING SYNC
player_stop() PLAYING READY SYNC
player_pause() PLAYING PAUSED SYNC

State Dependent Function Calls

The following table shows state-dependent function calls. It is forbidden to call the functions listed below in wrong states. Violation of this rule may result in unpredictable behavior.

FUNCTION VALID STATES DESCRIPTION
player_create() ANY -
player_destroy() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_prepare() IDLE This function must be called after player_create()
player_unprepare() READY/ PLAYING/ PAUSED This function must be called after player_prepare()
player_start() READY/ PAUSED This function must be called after player_prepare()
player_stop() PLAYING/ PAUSED This function must be called after player_start() or player_pause()
player_pause() PLAYING This function must be called after player_start()
player_set_completed_cb()
player_set_interrupted_cb()
player_set_error_cb()
player_set_buffering_cb()
player_set_subtitle_updated_cb()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_set_video_stream_changed_cb()
player_set_media_stream_seek_cb()
player_set_media_stream_buffer_status_cb()
player_set_media_packet_video_frame_decoded_cb()
IDLE This function must be called before player_prepare()
player_unset_completed_cb()
player_unset_interrupted_cb()
player_unset_error_cb()
player_unset_buffering_cb()
player_unset_subtitle_updated_cb()
player_unset_video_stream_changed_cb()
player_unset_media_stream_seek_cb()
player_unset_media_stream_buffer_status_cb()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after register callback functions such as player_set_completed_cb()
player_unset_media_packet_video_frame_decoded_cb() IDLE/ READY This function must be called after player_set_media_packet_video_frame_decoded_cb()
player_get_state() ANY -
player_set_uri() IDLE This function must be called before player_prepare()
player_set_memory_buffer() IDLE This function must be called before player_prepare()
player_set_subtitle_path() IDLE/ READY/ PLAYING/ PAUSED This function must be called before player_create()
player_set_volume() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_volume() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_set_sound_stream_info() IDLE This function must be called before player_prepare()
player_set_sound_type() IDLE This function must be called before player_prepare()
player_set_mute() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_is_muted() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_set_looping() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_is_looping() IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_duration() PLAYING/ PAUSED This function must be called after player_start()
player_set_display() IDLE This function must be called before player_prepare()
player_set_display_mode()
player_set_display_visible()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_display_rotation()
player_is_display_visible()
IDLE/ READY/ PLAYING/ PAUSED This function must be called after player_create()
player_get_video_size() READY/ PLAYING/ PAUSED This function must be called after player_prepare()
player_set_subtitle_position_offset() PLAYING/ PAUSED This function must be called after player_start()
player_get_current_track()
player_get_track_language_code()
player_get_track_count()
player_select_track()
READY/ PLAYING/ PAUSED This function must be called after player_prepare()
player_set_audio_only() READY/ PLAYING/ PAUSED This function must be called after player_prepare()
player_set_streaming_buffering_time() IDLE This function must be called before player_prepare()

Asynchronous Operations

All functions that change the player state are synchronous except player_prepare_async(), player_set_play_position(), and player_capture_video(). Thus the result is passed to the application via the callback mechanism.

Callback(Event) Operations

REGISTER UNREGISTER CALLBACK DESCRIPTION
player_set_completed_cb() player_unset_completed_cb() player_completed_cb() called when playback is completed
player_set_interrupted_cb() player_unset_interrupted_cb() player_interrupted_cb() called when playback is interrupted by player_interrupted_code_e
player_set_error_cb() player_unset_error_cb() player_error_cb() called when an error has occurred
player_set_buffering_cb() player_unset_buffering_cb() player_buffering_cb() called during content buffering
player_set_progressive_download_message_cb() player_unset_progressive_download_message_cb() player_pd_message_cb() called when a progressive download starts or completes
player_set_subtitle_updated_cb() player_unset_subtitle_updated_cb() player_subtitle_updated_cb() called when a subtitle updates
player_set_media_packet_video_frame_decoded_cb() player_unset_media_packet_video_frame_decoded_cb() player_media_packet_video_decoded_cb() called when a video frame is decoded
player_set_media_stream_seek_cb() player_unset_media_stream_seek_cb() player_media_stream_seek_cb() called when seeking is occurred during playback with external media buffer
player_set_media_stream_buffer_status_cb() player_unset_media_stream_buffer_status_cb() player_media_stream_buffer_status_cb() called when the buffer underrun or overflow is detected during playback with external media buffer
player_set_video_stream_changed_cb() player_unset_video_stream_changed_cb() player_video_stream_changed_cb()

called when the video stream info is changed

Functions

int player_create (player_h *player)
 Creates a player handle for playing multimedia content.
int player_destroy (player_h player)
 Destroys the media player handle and releases all its resources.
int player_prepare (player_h player)
 Prepares the media player for playback.
int player_prepare_async (player_h player, player_prepared_cb callback, void *user_data)
 Prepares the media player for playback, asynchronously.
int player_unprepare (player_h player)
 Resets the media player.
int player_set_uri (player_h player, const char *uri)
 Sets the data source (file-path, HTTP or RTSP URI) to use.
int player_set_memory_buffer (player_h player, const void *data, int size)
 Sets memory as the data source.
int player_get_state (player_h player, player_state_e *state)
 Gets the player's current state.
int player_set_volume (player_h player, float left, float right)
 Sets the player's volume.
int player_get_volume (player_h player, float *left, float *right)
 Gets the player's current volume factor.
int player_set_sound_type (player_h player, sound_type_e type) TIZEN_DEPRECATED_API
 Sets the player's volume type.
int player_set_sound_stream_info (player_h player, sound_stream_info_h stream_info)
 Sets the player's sound manager stream information.
int player_set_audio_latency_mode (player_h player, audio_latency_mode_e latency_mode)
 Sets the audio latency mode.
int player_get_audio_latency_mode (player_h player, audio_latency_mode_e *latency_mode)
 Gets the current audio latency mode.
int player_start (player_h player)
 Starts or resumes playback.
int player_stop (player_h player)
 Stops playing media content.
int player_pause (player_h player)
 Pauses the player.
int player_set_play_position (player_h player, int millisecond, bool accurate, player_seek_completed_cb callback, void *user_data)
 Sets the seek position for playback, asynchronously.
int player_get_play_position (player_h player, int *millisecond)
 Gets the current position in milliseconds.
int player_set_mute (player_h player, bool muted)
 Sets the player's mute status.
int player_is_muted (player_h player, bool *muted)
 Gets the player's mute status.
int player_set_looping (player_h player, bool looping)
 Sets the player's looping status.
int player_is_looping (player_h player, bool *looping)
 Gets the player's looping status.
int player_set_display (player_h player, player_display_type_e type, player_display_h display)
 Sets the video display.
int player_set_media_packet_video_frame_decoded_cb (player_h player, player_media_packet_video_decoded_cb callback, void *user_data)
 Sets a media packet video callback function to be called once per frame.
int player_unset_media_packet_video_frame_decoded_cb (player_h player)
 Unsets the media packet video frame callback function.
int player_push_media_stream (player_h player, media_packet_h packet)
 Pushes elementary stream to decode audio or video.
int player_set_media_stream_info (player_h player, player_stream_type_e type, media_format_h format)
 Sets contents information for media stream.
int player_set_media_stream_buffer_status_cb (player_h player, player_stream_type_e type, player_media_stream_buffer_status_cb callback, void *user_data)
 Sets a callback function to be invoked when buffer underrun or overflow is occurred.
int player_unset_media_stream_buffer_status_cb (player_h player, player_stream_type_e type)
 Unsets the buffer status callback function.
int player_set_media_stream_seek_cb (player_h player, player_stream_type_e type, player_media_stream_seek_cb callback, void *user_data)
 Sets a callback function to be invoked when seeking is occurred.
int player_unset_media_stream_seek_cb (player_h player, player_stream_type_e type)
 Unsets the seek callback function.
int player_set_media_stream_buffer_max_size (player_h player, player_stream_type_e type, unsigned long long max_size)
 Sets the max size bytes of buffer.
int player_get_media_stream_buffer_max_size (player_h player, player_stream_type_e type, unsigned long long *max_size)
 Gets the max size bytes of buffer.
int player_set_media_stream_buffer_min_threshold (player_h player, player_stream_type_e type, unsigned int percent)
 Sets the buffer threshold percent of buffer.
int player_get_media_stream_buffer_min_threshold (player_h player, player_stream_type_e type, unsigned int *percent)
 Gets the buffer threshold percent of buffer.
int player_capture_video (player_h player, player_video_captured_cb callback, void *user_data)
 Captures the video frame, asynchronously.
int player_set_streaming_cookie (player_h player, const char *cookie, int size)
 Sets the cookie for streaming playback.
int player_set_streaming_user_agent (player_h player, const char *user_agent, int size)
 Sets the streaming user agent for playback.
int player_get_streaming_download_progress (player_h player, int *start, int *current)
 Gets the download progress for streaming playback.
int player_set_completed_cb (player_h player, player_completed_cb callback, void *user_data)
 Sets a callback function to be invoked when the playback is finished.
int player_unset_completed_cb (player_h player)
 Unsets the playback completed callback function.
int player_set_interrupted_cb (player_h player, player_interrupted_cb callback, void *user_data)
 Sets a callback function to be invoked when the playback is interrupted or the interrupt is completed.
int player_unset_interrupted_cb (player_h player)
 Unsets the interrupted callback function.
int player_set_error_cb (player_h player, player_error_cb callback, void *user_data)
 Sets a callback function to be invoked when an error occurs.
int player_unset_error_cb (player_h player)
 Unsets the error callback function.
int player_set_buffering_cb (player_h player, player_buffering_cb callback, void *user_data)
 Sets a callback function to be invoked when there is a change in the buffering status of a media stream.
int player_unset_buffering_cb (player_h player)
 Unsets the buffering callback function.
int player_set_progressive_download_path (player_h player, const char *path) TIZEN_DEPRECATED_API
 Sets a path to download, progressively.
int player_get_progressive_download_status (player_h player, unsigned long *current, unsigned long *total_size) TIZEN_DEPRECATED_API
 Gets the status of progressive download.
int player_set_progressive_download_message_cb (player_h player, player_pd_message_cb callback, void *user_data) TIZEN_DEPRECATED_API
 Sets a callback function to be invoked when progressive download is started or completed.
int player_unset_progressive_download_message_cb (player_h player) TIZEN_DEPRECATED_API
 Unsets the progressive download message callback function.
int player_set_playback_rate (player_h player, float rate)
 Sets the playback rate.
int player_get_current_track (player_h player, player_stream_type_e type, int *index)
 Gets current track index.
int player_get_track_language_code (player_h player, player_stream_type_e type, int index, char **code)
 Gets language code of a track.
int player_get_track_count (player_h player, player_stream_type_e type, int *count)
 Gets the track count.
int player_select_track (player_h player, player_stream_type_e type, int index)
 Selects a track to play.
int player_foreach_adaptive_variant (player_h player, player_adaptive_variant_cb callback, void *user_data)
 Retrieves all the streaming variant information.
int player_set_max_adaptive_variant_limit (player_h player, int bandwidth, int width, int height)
 Sets the maximum limit of the streaming variant.
int player_get_max_adaptive_variant_limit (player_h player, int *bandwidth, int *width, int *height)
 Gets the maximum limit of the streaming variant.
int player_set_audio_only (player_h player, bool audio_only)
 Sets the audio only mode.
int player_is_audio_only (player_h player, bool *audio_only)
 Gets the audio only mode status.
int player_set_streaming_buffering_time (player_h player, int prebuffer_ms, int rebuffer_ms)
 Sets the streaming buffering time.
int player_get_streaming_buffering_time (player_h player, int *prebuffer_ms, int *rebuffer_ms)
 Gets the streaming buffering time.

Typedefs

typedef struct player_s * player_h
 The media player's type handle.
typedef void(* player_prepared_cb )(void *user_data)
 Called when the media player is prepared.
typedef void(* player_completed_cb )(void *user_data)
 Called when the media player is completed.
typedef void(* player_seek_completed_cb )(void *user_data)
 Called when the seek operation is completed.
typedef void(* player_interrupted_cb )(player_interrupted_code_e code, void *user_data)
 Called when the media player is interrupted.
typedef void(* player_error_cb )(int error_code, void *user_data)
 Called when an error occurs in the media player.
typedef void(* player_buffering_cb )(int percent, void *user_data)
 Called when the buffering percentage of the media playback is updated.
typedef void(* player_pd_message_cb )(player_pd_message_type_e type, void *user_data)
 Called when progressive download is started or completed.
typedef void(* player_video_captured_cb )(unsigned char *captured_data, int width, int height, unsigned int size, void *user_data)
 Called when the video is captured.
typedef void(* player_media_packet_video_decoded_cb )(media_packet_h packet, void *user_data)
 Called to register for notifications about delivering media packet when every video frame is decoded.
typedef void(* player_media_stream_buffer_status_cb )(player_media_stream_buffer_status_e status, void *user_data)
 Called when the buffer level drops below the threshold of max size or no free space in buffer.
typedef void(* player_media_stream_seek_cb )(unsigned long long offset, void *user_data)
 Called to notify the next push-buffer offset when seeking is occurred.
typedef void(* player_adaptive_variant_cb )(int bandwidth, int width, int height, void *user_data)
 Called to notify the streaming variant information.

Typedef Documentation

typedef void(* player_adaptive_variant_cb)(int bandwidth, int width, int height, void *user_data)

Called to notify the streaming variant information.

The adaptive streaming protocol(hls, mpeg dash) can support variant stream condition. All the streaming variant information can be shared by calling player_foreach_adaptive_variant().

Since :
4.0
Parameters:
[in]bandwidthThe bandwidth of the stream can be supportable, this is mandatory parameter
[in]widthThe width of the stream, this is optional parameter
[in]heightThe height of the stream, this is optional parameter
[in]user_dataThe user data passed from the callback registration function
See also:
player_foreach_adaptive_variant()
typedef void(* player_buffering_cb)(int percent, void *user_data)

Called when the buffering percentage of the media playback is updated.

If the buffer is full, it will return 100%.

Since :
2.3
Parameters:
[in]percentThe percentage of buffering completed (0~100)
[in]user_dataThe user data passed from the callback registration function
See also:
player_set_buffering_cb()
player_unset_buffering_cb()
typedef void(* player_completed_cb)(void *user_data)

Called when the media player is completed.

It will be invoked when player has reached the end of the stream.

Since :
2.3
Parameters:
[in]user_dataThe user data passed from the callback registration function
Precondition:
It will be invoked when the playback is completed if you register this callback using player_set_completed_cb().
See also:
player_set_completed_cb()
player_unset_completed_cb()
typedef void(* player_error_cb)(int error_code, void *user_data)
typedef struct player_s* player_h

The media player's type handle.

Since :
2.3
typedef void(* player_interrupted_cb)(player_interrupted_code_e code, void *user_data)

Called when the media player is interrupted.

If the code is PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT, the player state will be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, or PLAYER_STATE_PAUSED. Application should get exact state by calling player_get_state().

Since :
2.3
Parameters:
[in]codeThe interrupted error code
[in]user_dataThe user data passed from the callback registration function
See also:
player_set_interrupted_cb()
player_unset_interrupted_cb()
player_get_state()
typedef void(* player_media_packet_video_decoded_cb)(media_packet_h packet, void *user_data)

Called to register for notifications about delivering media packet when every video frame is decoded.

Since :
2.3
Remarks:
The UI update code must not be directly invoked.
The packet should be released using media_packet_destroy().
If not, the decoder will fail due to having insufficient buffer space for the decoded frame.
Parameters:
[in]packetReference pointer to the media packet
[in]user_dataThe user data passed from the callback registration function

Called when the buffer level drops below the threshold of max size or no free space in buffer.

Since :
2.4
Remarks:
This function is used for media stream playback only.
Parameters:
[in]statusThe buffer status
[in]user_dataThe user data passed from the callback registration function
See also:
player_set_media_stream_buffer_status_cb()
player_set_media_stream_buffer_max_size()
player_set_media_stream_buffer_min_threshold()
typedef void(* player_media_stream_seek_cb)(unsigned long long offset, void *user_data)

Called to notify the next push-buffer offset when seeking is occurred.

The next push-buffer should produce buffers from the new offset.

Since :
2.4
Remarks:
This function is used for media stream playback only.
Parameters:
[in]offsetThe new byte position to seek
[in]user_dataThe user data passed from the callback registration function
typedef void(* player_pd_message_cb)(player_pd_message_type_e type, void *user_data)

Called when progressive download is started or completed.

Since :
2.3
Parameters:
[in]typeThe message type for progressive download
[in]user_dataThe user data passed from the callback registration function
See also:
player_set_progressive_download_path()
typedef void(* player_prepared_cb)(void *user_data)

Called when the media player is prepared.

It will be invoked when player has reached the begin of stream.

Since :
2.3
Parameters:
[in]user_dataThe user data passed from the callback registration function
Precondition:
player_prepare_async() will cause this callback.
Postcondition:
The player state will be PLAYER_STATE_READY.
See also:
player_prepare_async()
typedef void(* player_seek_completed_cb)(void *user_data)

Called when the seek operation is completed.

Since :
2.3
Parameters:
[in]user_dataThe user data passed from the callback registration function
See also:
player_set_play_position()
typedef void(* player_video_captured_cb)(unsigned char *captured_data, int width, int height, unsigned int size, void *user_data)

Called when the video is captured.

Since :
2.3
Remarks:
The color space format of the captured image is IMAGE_UTIL_COLORSPACE_RGB888.
The captured_data should not be released and it can be used only in the callback. To use outside, make a copy.
Parameters:
[in]captured_dataThe captured image buffer
[in]widthThe width of the captured image
[in]heightThe height of the captured image
[in]sizeThe size of the captured image
[in]user_dataThe user data passed from the callback registration function
See also:
player_capture_video()

Enumeration Type Documentation

Enumeration for audio latency mode.

Since :
2.3
Enumerator:
AUDIO_LATENCY_MODE_LOW 

Low audio latency mode

AUDIO_LATENCY_MODE_MID 

Middle audio latency mode

AUDIO_LATENCY_MODE_HIGH 

High audio latency mode

Enumeration for display type.

Since :
2.3
Enumerator:
PLAYER_DISPLAY_TYPE_OVERLAY 

Overlay surface display

PLAYER_DISPLAY_TYPE_OBSOLETE_EVAS_WNONE 

Obsolete. Acts as PLAYER_DISPLAY_TYPE_NONE on Wearable, PLAYER_DISPLAY_TYPE_EVAS in all other cases. This symbol was added for backward compatibility reasons. It should not be used. (Deprecated since 4.0)

PLAYER_DISPLAY_TYPE_OBSOLETE_NONE_WEVAS 

Obsolete. Acts as PLAYER_DISPLAY_TYPE_EVAS on Wearable 3.0 and later, PLAYER_DISPLAY_TYPE_NONE in all other cases. This symbol was added for backward compatibility reasons. It should not be used. (Deprecated since 4.0)

PLAYER_DISPLAY_TYPE_EVAS 

Evas image object surface display (Since 4.0)

PLAYER_DISPLAY_TYPE_NONE 

This disposes of buffers (Since 4.0)

Enumeration for media player's error codes.

Since :
2.3
Enumerator:
PLAYER_ERROR_NONE 

Successful

PLAYER_ERROR_OUT_OF_MEMORY 

Out of memory

PLAYER_ERROR_INVALID_PARAMETER 

Invalid parameter

PLAYER_ERROR_NO_SUCH_FILE 

No such file or directory

PLAYER_ERROR_INVALID_OPERATION 

Invalid operation

PLAYER_ERROR_FILE_NO_SPACE_ON_DEVICE 

No space left on the device

PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICE 

Not supported Feature

PLAYER_ERROR_SEEK_FAILED 

Seek operation failure

PLAYER_ERROR_INVALID_STATE 

Invalid state

PLAYER_ERROR_NOT_SUPPORTED_FILE 

File format not supported

PLAYER_ERROR_INVALID_URI 

Invalid URI

PLAYER_ERROR_SOUND_POLICY 

Sound policy error

PLAYER_ERROR_CONNECTION_FAILED 

Streaming connection failed

PLAYER_ERROR_VIDEO_CAPTURE_FAILED 

Video capture failed

PLAYER_ERROR_DRM_EXPIRED 

Expired license

PLAYER_ERROR_DRM_NO_LICENSE 

No license

PLAYER_ERROR_DRM_FUTURE_USE 

License for future use

PLAYER_ERROR_DRM_NOT_PERMITTED 

Format not permitted

PLAYER_ERROR_RESOURCE_LIMIT 

Resource limit

PLAYER_ERROR_PERMISSION_DENIED 

Permission denied

PLAYER_ERROR_SERVICE_DISCONNECTED 

Socket connection lost (Since 3.0)

PLAYER_ERROR_BUFFER_SPACE 

No buffer space available (Since 3.0)

PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODEC 

Not supported audio codec but video can be played (Since 4.0)

PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODEC 

Not supported video codec but audio can be played (Since 4.0)

PLAYER_ERROR_NOT_SUPPORTED_SUBTITLE 

Not supported subtitle format (Since 4.0)

Enumeration for media player's interruption type.

Since :
2.3
Enumerator:
PLAYER_INTERRUPTED_COMPLETED 

Interrupt completed (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_MEDIA 

Interrupted by a non-resumable media application (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_CALL 

Interrupted by an incoming call (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_EARJACK_UNPLUG 

Interrupted by unplugging headphones (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_RESOURCE_CONFLICT 

Interrupted by a resource conflict and the player handle will be paused or unprepared

PLAYER_INTERRUPTED_BY_ALARM 

Interrupted by an alarm (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_EMERGENCY 

Interrupted by an emergency (Deprecated since 3.0)

PLAYER_INTERRUPTED_BY_NOTIFICATION 

Interrupted by a notification (Deprecated since 3.0)

Enumeration of media stream buffer status.

Since :
2.4
See also:
player_set_media_stream_buffer_max_size()
player_set_media_stream_buffer_min_threshold()
Enumerator:
PLAYER_MEDIA_STREAM_BUFFER_UNDERRUN 

The buffer level is lower than the threshold

PLAYER_MEDIA_STREAM_BUFFER_OVERFLOW 

The buffer level is over than the threshold

Enumeration for progressive download message type.

Since :
2.3
Enumerator:
PLAYER_PD_STARTED 

Progressive download is started

PLAYER_PD_COMPLETED 

Progressive download is completed

Enumeration for media player state.

Since :
2.3
Enumerator:
PLAYER_STATE_NONE 

Player is not created

PLAYER_STATE_IDLE 

Player is created, but not prepared

PLAYER_STATE_READY 

Player is ready to play media

PLAYER_STATE_PLAYING 

Player is playing media

PLAYER_STATE_PAUSED 

Player is paused while playing media

Enumeration for stream type.

Since :
2.4
Enumerator:
PLAYER_STREAM_TYPE_DEFAULT 

Container type

PLAYER_STREAM_TYPE_AUDIO 

Audio element stream type

PLAYER_STREAM_TYPE_VIDEO 

Video element stream type

PLAYER_STREAM_TYPE_TEXT 

Text type


Function Documentation

int player_capture_video ( player_h  player,
player_video_captured_cb  callback,
void *  user_data 
)

Captures the video frame, asynchronously.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().
Video display type should be set by calling player_set_display() otherwise, audio stream is only processed even though video file is set.
Postcondition:
It invokes player_video_captured_cb() when capture completes, if you set a callback.
See also:
player_video_captured_cb()
int player_create ( player_h player)

Creates a player handle for playing multimedia content.

Since :
2.3
Remarks:
You must release player by using player_destroy().
Although you can create multiple player handles at the same time, the player cannot guarantee proper operation because of limited resources, such as audio or display device.
Parameters:
[out]playerA new handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_OUT_OF_MEMORYOut of memory
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_RESOURCE_LIMITCannot create more instance due to resource(socket, thread, etc) limitation on system.
Postcondition:
The player state will be PLAYER_STATE_IDLE.
See also:
player_destroy()
int player_destroy ( player_h  player)

Destroys the media player handle and releases all its resources.

Since :
2.3
Remarks:
To completely shutdown player operation, call this function with a valid player handle from any player state.
Parameters:
[in]playerThe handle to the media player to be destroyed
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
Postcondition:
The player state will be PLAYER_STATE_NONE.
See also:
player_create()
int player_foreach_adaptive_variant ( player_h  player,
player_adaptive_variant_cb  callback,
void *  user_data 
)

Retrieves all the streaming variant information.

Since :
4.0
Remarks:
This function is used for adaptive streaming(hls/mpeg dash) only.
Parameters:
[in]playerThe handle to the media player
[in]callbackThe iteration callback function
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED
See also:
player_adaptive_variant_cb
int player_get_audio_latency_mode ( player_h  player,
audio_latency_mode_e latency_mode 
)

Gets the current audio latency mode.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]latency_modeThe latency mode to get from the audio
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
audio_latency_mode_e
player_set_audio_latency_mode()
int player_get_current_track ( player_h  player,
player_stream_type_e  type,
int *  index 
)

Gets current track index.

Index starts from 0.

Since :
2.4
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
[out]indexThe index of track
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED
int player_get_max_adaptive_variant_limit ( player_h  player,
int *  bandwidth,
int *  width,
int *  height 
)

Gets the maximum limit of the streaming variant.

Since :
4.0
Remarks:
This function is used for adaptive streaming(hls/mpeg dash) only.
Parameters:
[in]playerThe handle to the media player
[out]bandwidthThe max bandwidth limit of the stream variant (default: -1)
[out]widthThe max width limit of the stream variant (deafult: -1)
[out]heightThe max height limit of the stream variant (deafult: -1)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_foreach_adaptive_variant()
player_set_max_adaptive_variant_limit()
int player_get_media_stream_buffer_max_size ( player_h  player,
player_stream_type_e  type,
unsigned long long *  max_size 
)

Gets the max size bytes of buffer.

Since :
2.4
Remarks:
This function is used for media stream playback only.
If the buffer level over the max size, player_media_stream_buffer_status_cb() will be invoked with overflow status.
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[out]max_sizeThe max bytes of buffer
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_media_stream_buffer_max_size()
player_media_stream_buffer_status_cb()
int player_get_media_stream_buffer_min_threshold ( player_h  player,
player_stream_type_e  type,
unsigned int *  percent 
)

Gets the buffer threshold percent of buffer.

Since :
2.4
Remarks:
This function is used for media stream playback only.
If the buffer level drops below the percent value, player_media_stream_buffer_status_cb() will be invoked with underrun status.
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[out]percentThe minimum threshold(0~100) of buffer
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_media_stream_buffer_min_threshold()
player_media_stream_buffer_status_cb()
int player_get_play_position ( player_h  player,
int *  millisecond 
)

Gets the current position in milliseconds.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]millisecondThe current position in milliseconds
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_SEEK_FAILEDSeek operation failure
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_play_position()
int player_get_progressive_download_status ( player_h  player,
unsigned long *  current,
unsigned long *  total_size 
)

Gets the status of progressive download.

Deprecated:
Deprecated since 4.0.
Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]currentThe current download position (bytes)
[out]total_sizeThe total size of the file (bytes)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The progressive download path must be set by calling player_set_progressive_download_path().
The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().
int player_get_state ( player_h  player,
player_state_e state 
)

Gets the player's current state.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]stateThe current state of the player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
player_state_e
int player_get_streaming_buffering_time ( player_h  player,
int *  prebuffer_ms,
int *  rebuffer_ms 
)

Gets the streaming buffering time.

Since :
4.0
Parameters:
[in]playerThe handle to the media player
[in]prebuffer_msThe buffer time to start playback
[in]rebuffer_msThe buffer time during playback if player enter pause state for buffering.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_get_streaming_buffering_time()
int player_get_streaming_download_progress ( player_h  player,
int *  start,
int *  current 
)

Gets the download progress for streaming playback.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]startThe starting position in percentage [0, 100]
[out]currentThe current position in percentage [0, 100]
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().
int player_get_track_count ( player_h  player,
player_stream_type_e  type,
int *  count 
)

Gets the track count.

Since :
2.4
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
[out]countThe number of track
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED
int player_get_track_language_code ( player_h  player,
player_stream_type_e  type,
int  index,
char **  code 
)

Gets language code of a track.

Since :
2.4
Remarks:
code must be released with free() by caller
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
[in]indexThe index of track
[out]codeA language code in ISO 639-1. "und" will be returned if the language is undefined.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED
int player_get_volume ( player_h  player,
float *  left,
float *  right 
)

Gets the player's current volume factor.

The range of left and right is from 0 to 1.0, inclusive (1.0 = 100%). This function gets the player volume, not the system volume. To get the system volume, use the Sound Manager API.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]leftThe current left volume scalar
[out]rightThe current right volume scalar
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_volume()
int player_is_audio_only ( player_h  player,
bool *  audio_only 
)

Gets the audio only mode status.

Since :
4.0
Parameters:
[in]playerThe handle to the media player
[out]audio_onlyThe current audio only status: (true = audio only enabled, false = audio only disabled)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of: PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_audio_only()
int player_is_looping ( player_h  player,
bool *  looping 
)

Gets the player's looping status.

If the looping status is true, playback automatically restarts upon finishing. If it is false, it won't.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]loopingThe looping status: (true = looping, false = non-looping )
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_looping()
int player_is_muted ( player_h  player,
bool *  muted 
)

Gets the player's mute status.

If the mute status is true, no sounds are played. If it is false, sounds are played at the previously set volume level.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[out]mutedThe current mute status: (true = mute, false = not muted)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_set_mute()
int player_pause ( player_h  player)

Pauses the player.

Since :
2.3
Remarks:
You can resume playback using player_start().
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid state
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_SOUND_POLICYSound policy error
Precondition:
The player state must be set to PLAYER_STATE_PLAYING.
Postcondition:
The player state will be PLAYER_STATE_PAUSED.
See also:
player_start()
int player_prepare ( player_h  player)

Prepares the media player for playback.

Since :
2.3
Remarks:
The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_URIInvalid URI
PLAYER_ERROR_NO_SUCH_FILEFile not found
PLAYER_ERROR_NOT_SUPPORTED_FILEFile not supported
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_PERMISSION_DENIEDPermission denied
PLAYER_ERROR_NOT_SUPPORTED_AUDIO_CODECNot support audio codec format (Since 4.0)
PLAYER_ERROR_NOT_SUPPORTED_VIDEO_CODECNot support video codec format (Since 4.0)
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play.
Postcondition:
The player state will be PLAYER_STATE_READY.
See also:
player_prepare_async()
player_unprepare()
player_set_uri()
int player_prepare_async ( player_h  player,
player_prepared_cb  callback,
void *  user_data 
)

Prepares the media player for playback, asynchronously.

Since :
2.3
Remarks:
The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_URIInvalid URI
PLAYER_ERROR_NO_SUCH_FILEFile not found
PLAYER_ERROR_NOT_SUPPORTED_FILEFile not supported
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_PERMISSION_DENIEDPermission denied
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare(). After that, call player_set_uri() to load the media content you want to play.
Postcondition:
It invokes player_prepared_cb() when playback is prepared.
See also:
player_prepare()
player_prepared_cb()
player_unprepare()
player_set_uri()
int player_push_media_stream ( player_h  player,
media_packet_h  packet 
)

Pushes elementary stream to decode audio or video.

Since :
2.4
Remarks:
player_set_media_stream_info() must be called before using this function.
The available buffer size can be set by calling player_set_media_stream_buffer_max_size(). If there is no available buffer space, this function will return error since 3.0.
Parameters:
[in]playerThe handle to media player
[in]packetThe media packet to decode
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid state
PLAYER_ERROR_NOT_SUPPORTED_FILEFile not supported
PLAYER_ERROR_BUFFER_SPACENo buffer space available (since 3.0)
PLAYER_ERROR_INVALID_OPERATIONInvalid operation (since 3.0)
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING or PLAYER_STATE_PAUSED.
See also:
player_set_media_stream_info()
player_set_media_stream_buffer_max_size()
int player_select_track ( player_h  player,
player_stream_type_e  type,
int  index 
)

Selects a track to play.

Since :
2.4
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT
[in]indexThe index of track
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED
See also:
player_get_current_track()
int player_set_audio_latency_mode ( player_h  player,
audio_latency_mode_e  latency_mode 
)

Sets the audio latency mode.

Since :
2.3
Remarks:
The default audio latency mode of the player is AUDIO_LATENCY_MODE_MID. To get the current audio latency mode, use player_get_audio_latency_mode(). If it's high mode, audio output interval can be increased so, it can keep more audio data to play. But, state transition like pause or resume can be more slower than default(mid) mode.
Parameters:
[in]playerThe handle to the media player
[in]latency_modeThe latency mode to be applied to the audio
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
audio_latency_mode_e
player_get_audio_latency_mode()
int player_set_audio_only ( player_h  player,
bool  audio_only 
)

Sets the audio only mode.

This function is used to disable or enable video rendering during playback.

Since :
4.0
Parameters:
[in]playerThe handle to the media player
[in]audio_onlyThe new audio only status: (true = enable audio only, false = disable audio only)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of: PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_is_audio_only()
int player_set_buffering_cb ( player_h  player,
player_buffering_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when there is a change in the buffering status of a media stream.

Since :
2.3
Remarks:
The media resource should be streamed over the network.
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Postcondition:
player_buffering_cb() will be invoked.
See also:
player_unset_buffering_cb()
player_set_uri()
player_buffering_cb()
int player_set_completed_cb ( player_h  player,
player_completed_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when the playback is finished.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Postcondition:
player_completed_cb() will be invoked.
See also:
player_unset_completed_cb()
player_completed_cb()
player_start()
int player_set_display ( player_h  player,
player_display_type_e  type,
player_display_h  display 
)

Sets the video display.

Since :
2.3
Remarks:
To get display to set, use GET_DISPLAY().
We are not supporting changing display.
This function have be called before calling the player_prepare() or player_prepare_async()
to reflect the display type.
Parameters:
[in]playerThe handle to the media player
[in]typeThe display type
[in]displayThe handle to display
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_display_type_e
player_set_display_mode
player_set_display_roi_area
player_set_display_visible
player_set_display_rotation
int player_set_error_cb ( player_h  player,
player_error_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when an error occurs.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Postcondition:
player_error_cb() will be invoked.
See also:
player_unset_error_cb()
player_error_cb()
int player_set_interrupted_cb ( player_h  player,
player_interrupted_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when the playback is interrupted or the interrupt is completed.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Postcondition:
player_interrupted_cb() will be invoked.
See also:
player_unset_interrupted_cb()
player_interrupted_code_e
player_interrupted_cb()
int player_set_looping ( player_h  player,
bool  looping 
)

Sets the player's looping status.

If the looping status is true, playback automatically restarts upon finishing. If it is false, it won't. The default value is false.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]loopingThe new looping status: (true = looping, false = non-looping )
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_is_looping()
int player_set_max_adaptive_variant_limit ( player_h  player,
int  bandwidth,
int  width,
int  height 
)

Sets the maximum limit of the streaming variant.

Since :
4.0
Remarks:
This function is used for adaptive streaming(hls/mpeg dash) only.
The bandwidth setting can only be applied if there is no width, height information at streaming variant header. Application can get all the variant information by calling player_foreach_adaptive_variant() function.
If there is no affordable stream for the condition, the minimum bandwidth stream will be selected.
Parameters:
[in]playerThe handle to the media player
[in]bandwidthThe max bandwidth limit of the stream variant (default: -1)
[in]widthThe max width limit of the stream variant (deafult: -1)
[in]heightThe max height limit of the stream variant (deafult: -1)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_foreach_adaptive_variant()
player_get_max_adaptive_variant_limit()

Sets a media packet video callback function to be called once per frame.

Since :
2.3
Remarks:
This function must be called before calling player_prepare() or player_prepare_async().
A registered callback is called in a separate thread (not in the main loop).
A video frame can be retrieved using a registered callback as a media packet.
The callback function holds the same buffer that will be drawn on the display device.
So if you change the media packet in a registered callback, it will be displayed on the device
and the media packet is available until it's destroyed by media_packet_destroy().
The packet have to be destroyed as quickly as possible after rendering the packet
and all the packets have to be destroyed before player_unprepare() is called.
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to be registered
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid state
Precondition:
The player's state must be PLAYER_STATE_IDLE. And, PLAYER_DISPLAY_TYPE_NONE must be set by calling player_set_display().
See also:
player_unset_media_packet_video_frame_decoded_cb
int player_set_media_stream_buffer_max_size ( player_h  player,
player_stream_type_e  type,
unsigned long long  max_size 
)

Sets the max size bytes of buffer.

Since :
2.4
Remarks:
This function is used for media stream playback only.
If the buffer level over the max size, player_media_stream_buffer_status_cb() will be invoked with overflow status.
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[in]max_sizeThe max bytes of buffer, it has to be bigger than zero. (default: 200000)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. (since 3.0)
See also:
player_get_media_stream_buffer_max_size()
player_media_stream_buffer_status_cb()
int player_set_media_stream_buffer_min_threshold ( player_h  player,
player_stream_type_e  type,
unsigned int  percent 
)

Sets the buffer threshold percent of buffer.

Since :
2.4
Remarks:
This function is used for media stream playback only.
If the buffer level drops below the percent value, player_media_stream_buffer_status_cb() will be invoked with underrun status.
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[in]percentThe minimum threshold(0~100) of buffer (default: 0)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED. (since 3.0)
See also:
player_get_media_stream_buffer_min_threshold()
player_media_stream_buffer_status_cb()

Sets a callback function to be invoked when buffer underrun or overflow is occurred.

Since :
2.4
Remarks:
This function is used for media stream playback only.
The callback is called in a separate thread (not in the main loop).
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[in]callbackThe buffer status callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
Postcondition:
player_media_stream_buffer_status_cb() will be invoked.
See also:
player_unset_media_stream_buffer_status_cb()
player_media_stream_buffer_status_cb()

Sets contents information for media stream.

Since :
2.4
Remarks:
AV format must be set before pushing elementary stream with player_push_media_stream().
This function must be called before calling the player_prepare() or player_prepare_async() to reflect the media information.
AAC can be supported.
H.264 can be supported.
Parameters:
[in]playerThe handle to media player
[in]typeThe type of target stream
[in]formatThe media format to set audio information
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid state
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_push_media_stream()
int player_set_media_stream_seek_cb ( player_h  player,
player_stream_type_e  type,
player_media_stream_seek_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when seeking is occurred.

Since :
2.4
Remarks:
This function is used for media stream playback only.
The callback is called in a separate thread (not in the main loop).
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
Postcondition:
player_media_stream_seek_cb() will be invoked.
See also:
player_unset_media_stream_seek_cb()
player_media_stream_seek_cb()
int player_set_memory_buffer ( player_h  player,
const void *  data,
int  size 
)

Sets memory as the data source.

Associates media content, cached in memory, with the player. Unlike the case of player_set_uri(), the media resides in memory. If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.

Since :
2.3
Remarks:
If you provide an invalid data, you won't receive an error message until you call player_start().
This function must be called before calling the player_prepare() or player_prepare_async() to build the player based on the data.
Parameters:
[in]playerThe handle to the media player
[in]dataThe memory pointer of media data
[in]sizeThe size of media data
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_set_uri()
int player_set_mute ( player_h  player,
bool  muted 
)

Sets the player's mute status.

If the mute status is true, no sounds are played. If it is false, sounds are played at the previously set volume level. Until this function is called, by default the player is not muted.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]mutedThe new mute status: (true = mute, false = not muted)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The player state must be one of PLAYER_STATE_IDLE, PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
See also:
player_is_muted()
int player_set_play_position ( player_h  player,
int  millisecond,
bool  accurate,
player_seek_completed_cb  callback,
void *  user_data 
)

Sets the seek position for playback, asynchronously.

Since :
2.3
Remarks:
This function will trigger the seeking operation on player instance. Normally application need to wait for player_seek_completed_cb() before calling it again. Otherwise it will return PLAYER_ERROR_SEEK_FAILED. Please note that if application is playing external media data via player_set_media_stream_info(), then consecutive calling of this function will always success and no need to wait for player_seek_completed_cb() before next calling of this function.(since_tizen 3.0)
Even if you don't set visible to true by calling player_set_display_visible, the video will be shown when the _seek_completed cb is invoked.
In case of non-seekable content, it will return PLAYER_ERROR_INVALID_OPERATION. If application ignore this error, player will keep playing without changing play position.
Parameters:
[in]playerThe handle to the media player
[in]millisecondThe position in milliseconds from the start to the seek point
[in]accurateIf true the selected position is returned, but this might be considerably slow, if false the nearest key frame position is returned, but this might be faster but less accurate.
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_SEEK_FAILEDSeek operation failure
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
Postcondition:
It invokes player_seek_completed_cb() when seek operation completes, if you set a callback.
See also:
player_get_play_position()
int player_set_playback_rate ( player_h  player,
float  rate 
)

Sets the playback rate.

The default value is 1.0.

Since :
2.3
Remarks:
PLAYER_ERROR_INVALID_OPERATION occurs when streaming playback.
No operation is performed, if rate is 0.
The sound is muted, when playback rate is under 0.0 and over 2.0.
Parameters:
[in]playerThe handle to the media player
[in]rateThe playback rate (-5.0x ~ 5.0x)
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be one of PLAYER_STATE_READY, PLAYER_STATE_PLAYING, or PLAYER_STATE_PAUSED.
int player_set_progressive_download_message_cb ( player_h  player,
player_pd_message_cb  callback,
void *  user_data 
)

Sets a callback function to be invoked when progressive download is started or completed.

Deprecated:
Deprecated since 4.0.
Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]callbackThe callback function to register
[in]user_dataThe user data to be passed to the callback function
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
Precondition:
The path to download must be set by calling player_set_progressive_download_path().
Postcondition:
player_pd_message_cb() will be invoked.
See also:
player_unset_progressive_download_message_cb()
player_set_progressive_download_path()
int player_set_progressive_download_path ( player_h  player,
const char *  path 
)

Sets a path to download, progressively.

Deprecated:
Deprecated since 4.0.
Since :
2.3
Remarks:
Progressive download will be started when you invoke player_start().
This function must be called before calling the player_prepare() or player_prepare_async() to reflect the download path when the player is building.
The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to download and play located in the internal storage.
The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to download and play located in the external storage.
Parameters:
[in]playerThe handle to the media player
[in]pathThe absolute path to download
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_PERMISSION_DENIEDPermission denied
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_set_progressive_download_message_cb()
player_unset_progressive_download_message_cb()
int player_set_sound_stream_info ( player_h  player,
sound_stream_info_h  stream_info 
)

Sets the player's sound manager stream information.

Since :
3.0
Remarks:
You can set sound stream information including audio routing and volume type. For more details, please refer to sound_manager.h
This function must be called before calling the player_prepare() or player_prepare_async() to reflect the sound stream information when the player is building.
This function is related to the following feature:
http://tizen.org/feature/multimedia.player.stream_info
If this feature is not supported, the stream_type of the player is fixed to the SOUND_STREAM_TYPE_MEDIA.
Parameters:
[in]playerThe handle to the media player
[in]stream_infoThe sound manager info type
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_FEATURE_NOT_SUPPORTED_ON_DEVICEUnsupported feature
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create().
See also:
sound_stream_info_h
sound_manager_create_stream_information()
sound_manager_destroy_stream_information()
Example
       #include <player.h>
       #include <sound_manager.h>
       ...
       player_h player = NULL;
       sound_stream_info_h stream_info = NULL;
       sound_stream_type_e stream_type = SOUND_STREAM_TYPE_MEDIA;
       ...
       sound_manager_create_stream_information (stream_type, _focus_callback, use_data, &stream_info);
       player_create (&player);
       player_set_sound_stream_info (player, stream_info);
       ...
       player_prepare_async (player, _prepared_cb, udata);
       ...
int player_set_sound_type ( player_h  player,
sound_type_e  type 
)

Sets the player's volume type.

Deprecated:
Deprecated since 3.0. Use player_set_sound_stream_info() instead.
Since :
2.3
Remarks:
The default sound type of the player is SOUND_TYPE_MEDIA. To get the current sound type, use sound_manager_get_current_sound_type().
If stream_info already exists by calling sound_manager_create_stream_info(), It will return error since 3.0.
Parameters:
[in]playerThe handle to the media player
[in]typeThe sound type
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_SOUND_POLICYSound policy error
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create().
See also:
sound_manager_get_current_sound_type()
int player_set_streaming_buffering_time ( player_h  player,
int  prebuffer_ms,
int  rebuffer_ms 
)

Sets the streaming buffering time.

Since :
4.0
Parameters:
[in]playerThe handle to the media player
[in]prebuffer_msThe buffer time to start playback
[in]rebuffer_msThe buffer time during playback if player enter pause state for buffering.
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_STATEInvalid state
Precondition:
The player state must be PLAYER_STATE_IDLE.
See also:
player_get_streaming_buffering_time()
int player_set_streaming_cookie ( player_h  player,
const char *  cookie,
int  size 
)

Sets the cookie for streaming playback.

Since :
2.3
Remarks:
This function must be called before calling the player_prepare() or player_prepare_async() to reflect the cookie information when the streaming connection is set up.
Parameters:
[in]playerThe handle to the media player
[in]cookieThe cookie to set
[in]sizeThe size of the cookie
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_set_uri()
player_set_streaming_user_agent()
int player_set_streaming_user_agent ( player_h  player,
const char *  user_agent,
int  size 
)

Sets the streaming user agent for playback.

Since :
2.3
Remarks:
This function must be called before calling the player_prepare() or player_prepare_async() to reflect the user agent information when the streaming connection is set up.
Parameters:
[in]playerThe handle to the media player
[in]user_agentThe user agent to set
[in]sizeThe size of the user agent
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_set_uri()
player_set_streaming_cookie()
int player_set_uri ( player_h  player,
const char *  uri 
)

Sets the data source (file-path, HTTP or RTSP URI) to use.

Associates media contents, referred to by the URI, with the player. If the function call is successful, subsequent calls to player_prepare() and player_start() will start playing the media.

Since :
2.3
Remarks:
If you use HTTP or RTSP, URI must start with "http://" or "rtsp://". The default protocol is "file://". If you provide an invalid URI, you won't receive an error message until you call player_start().
This function must be called before calling the player_prepare() or player_prepare_async() to build the player based on the URI information.
The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage.
The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage.
The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from network.
Parameters:
[in]playerThe handle to the media player
[in]uriThe content location, such as the file path, the URI of the HTTP or RTSP stream you want to play
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_PERMISSION_DENIEDPermission denied
Precondition:
The player state must be set to PLAYER_STATE_IDLE by calling player_create() or player_unprepare().
See also:
player_set_memory_buffer()
int player_set_volume ( player_h  player,
float  left,
float  right 
)

Sets the player's volume.

Setting this volume adjusts the player's instance volume, not the system volume. The valid range is from 0 to 1.0, inclusive (1.0 = 100%). Default value is 1.0. To change system volume, use the Sound Manager API. Finally, it does not support to set other value into each channel currently.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
[in]leftThe left volume scalar
[in]rightThe right volume scalar
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_get_volume()
int player_start ( player_h  player)

Starts or resumes playback.

Plays current media content, or resumes play if paused.

Since :
2.3
Remarks:
Sound can be mixed with other sounds if you don't control the stream focus in sound-manager module since 3.0.
You can refer to Sound Manager.
Even if you don't set visible to true by calling player_set_display_visible, the video will be shown on PLAYER_STATE_PLAYING state.
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_CONNECTION_FAILEDNetwork connection failed
PLAYER_ERROR_SOUND_POLICYSound policy error
Precondition:
player_prepare() must be called before calling this function.
The player state must be set to PLAYER_STATE_READY by calling player_prepare() or set to PLAYER_STATE_PAUSED by calling player_pause().
Postcondition:
The player state will be PLAYER_STATE_PLAYING.
It invokes player_completed_cb() when playback completes, if you set a callback with player_set_completed_cb().
It invokes player_pd_message_cb() when progressive download starts or completes, if you set a download path with player_set_progressive_download_path() and a callback with player_set_progressive_download_message_cb().
See also:
player_prepare()
player_prepare_async()
player_stop()
player_pause()
player_set_completed_cb()
player_completed_cb()
player_set_progressive_download_path()
player_set_progressive_download_message_cb()
player_pd_message_cb()
player_set_display_visible()
int player_stop ( player_h  player)

Stops playing media content.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid state
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_SOUND_POLICYSound policy error
Precondition:
The player state must be set to PLAYER_STATE_PLAYING by calling player_start() or set to PLAYER_STATE_PAUSED by calling player_pause().
Postcondition:
The player state will be PLAYER_STATE_READY.
The downloading will be aborted if you use progressive download.
See also:
player_start()
player_pause()
int player_unprepare ( player_h  player)

Resets the media player.

The most recently used media is reset and no longer associated with the player. Playback is no longer possible. If you want to use the player again, you must set the data URI and call player_prepare() again.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
PLAYER_ERROR_INVALID_STATEInvalid player state
Precondition:
The player state must be higher than PLAYER_STATE_IDLE.
Postcondition:
The player state will be PLAYER_STATE_IDLE.
See also:
player_prepare()

Unsets the buffering callback function.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_buffering_cb()

Unsets the playback completed callback function.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_completed_cb()

Unsets the error callback function.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_error_cb()

Unsets the interrupted callback function.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_interrupted_cb()

Unsets the media packet video frame callback function.

Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
Precondition:
The player's state must be PLAYER_STATE_READY or PLAYER_STATE_IDLE
See also:
player_set_media_packet_video_frame_decoded_cb()

Unsets the buffer status callback function.

Since :
2.4
Remarks:
This function is used for media stream playback only.
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
player_set_media_stream_buffer_status_cb()

Unsets the seek callback function.

Since :
2.4
Parameters:
[in]playerThe handle to the media player
[in]typeThe type of target stream
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_STATEInvalid player state
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
See also:
player_set_media_stream_seek_cb()

Unsets the progressive download message callback function.

Deprecated:
Deprecated since 4.0.
Since :
2.3
Parameters:
[in]playerThe handle to the media player
Returns:
0 on success, otherwise a negative error value
Return values:
PLAYER_ERROR_NONESuccessful
PLAYER_ERROR_INVALID_PARAMETERInvalid parameter
PLAYER_ERROR_INVALID_OPERATIONInvalid operation
See also:
player_set_progressive_download_message_cb()