| 
    Tizen Native API
   
    
   
   | 
  
  
  
 
The Subtitle API provides functions to control the subtitle.
#include <player.h>
Functions | |
| int | player_set_subtitle_path (player_h player, const char *path) | 
| Sets a subtitle path.   | |
| int | player_set_subtitle_updated_cb (player_h player, player_subtitle_updated_cb callback, void *user_data) | 
| Registers a callback function to be invoked when a subtitle updates.   | |
| int | player_unset_subtitle_updated_cb (player_h player) | 
| Unregisters the callback function.   | |
| int | player_set_subtitle_position_offset (player_h player, int millisecond) | 
| Sets the seek position for the subtitle.   | |
| int | player_set_video_stream_changed_cb (player_h player, player_video_stream_changed_cb callback, void *user_data) | 
| Registers a callback function to be invoked when video stream is changed.   | |
| int | player_unset_video_stream_changed_cb (player_h player) | 
| Unregisters the video stream changed callback function.   | |
| 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 void(* | player_subtitle_updated_cb )(unsigned long duration, char *text, void *user_data) | 
| Called when the subtitle is updated.   | |
| typedef void(* player_subtitle_updated_cb)(unsigned long duration, char *text, void *user_data) | 
Called when the subtitle is updated.
| [in] | duration | The duration of the updated subtitle | 
| [in] | text | The text of the updated subtitle | 
| [in] | user_data | The user data passed from the callback registration function | 
| int player_foreach_adaptive_variant | ( | player_h | player, | 
| player_adaptive_variant_cb | callback, | ||
| void * | user_data | ||
| ) | 
Retrieves all the streaming variant information.
| [in] | player | The handle to the media player | 
| [in] | callback | The iteration callback function | 
| [in] | user_data | The user data to be passed to the callback function | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_get_current_track | ( | player_h | player, | 
| player_stream_type_e | type, | ||
| int * | index | ||
| ) | 
Gets current track index.
Index starts from 0.
| [in] | player | The handle to the media player | 
| [in] | type | The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT | 
| [out] | index | The index of track | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_get_max_adaptive_variant_limit | ( | player_h | player, | 
| int * | bandwidth, | ||
| int * | width, | ||
| int * | height | ||
| ) | 
Gets the maximum limit of the streaming variant.
| [in] | player | The handle to the media player | 
| [out] | bandwidth | The max bandwidth limit of the stream variant (default: -1) | 
| [out] | width | The max width limit of the stream variant (deafult: -1) | 
| [out] | height | The max height limit of the stream variant (deafult: -1) | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| int player_get_streaming_buffering_time | ( | player_h | player, | 
| int * | prebuffer_ms, | ||
| int * | rebuffer_ms | ||
| ) | 
Gets the streaming buffering time.
| [in] | player | The handle to the media player | 
| [in] | prebuffer_ms | The buffer time to start playback | 
| [in] | rebuffer_ms | The buffer time during playback if player enter pause state for buffering. | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_STATE | Invalid state | 
| int player_get_track_count | ( | player_h | player, | 
| player_stream_type_e | type, | ||
| int * | count | ||
| ) | 
Gets the track count.
| [in] | player | The handle to the media player | 
| [in] | type | The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT | 
| [out] | count | The number of track | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_get_track_language_code | ( | player_h | player, | 
| player_stream_type_e | type, | ||
| int | index, | ||
| char ** | code | ||
| ) | 
Gets language code of a track.
free() by caller | [in] | player | The handle to the media player | 
| [in] | type | The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT | 
| [in] | index | The index of track | 
| [out] | code | A language code in ISO 639-1. "und" will be returned if the language is undefined. | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_is_audio_only | ( | player_h | player, | 
| bool * | audio_only | ||
| ) | 
Gets the audio only mode status.
| [in] | player | The handle to the media player | 
| [out] | audio_only | The current audio only status: (true = audio only enabled, false = audio only disabled)  | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| int player_select_track | ( | player_h | player, | 
| player_stream_type_e | type, | ||
| int | index | ||
| ) | 
Selects a track to play.
| [in] | player | The handle to the media player | 
| [in] | type | The type of target stream which is PLAYER_STREAM_TYPE_AUDIO or PLAYER_STREAM_TYPE_TEXT | 
| [in] | index | The index of track | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| 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.
| [in] | player | The handle to the media player | 
| [in] | audio_only | The new audio only status: (true = enable audio only, false = disable audio only)  | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_set_max_adaptive_variant_limit | ( | player_h | player, | 
| int | bandwidth, | ||
| int | width, | ||
| int | height | ||
| ) | 
Sets the maximum limit of the streaming variant.
| [in] | player | The handle to the media player | 
| [in] | bandwidth | The max bandwidth limit of the stream variant (default: -1) | 
| [in] | width | The max width limit of the stream variant (deafult: -1) | 
| [in] | height | The max height limit of the stream variant (deafult: -1) | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| int player_set_streaming_buffering_time | ( | player_h | player, | 
| int | prebuffer_ms, | ||
| int | rebuffer_ms | ||
| ) | 
Sets the streaming buffering time.
| [in] | player | The handle to the media player | 
| [in] | prebuffer_ms | The buffer time to start playback | 
| [in] | rebuffer_ms | The buffer time during playback if player enter pause state for buffering. | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_STATE | Invalid state | 
| int player_set_subtitle_path | ( | player_h | player, | 
| const char * | path | ||
| ) | 
Sets a subtitle path.
NULL for reset before calling player_prepare() or player_prepare_async().| [in] | player | The handle to the media player | 
| [in] | path | The absolute path of the subtitle file, it can be NULL in the PLAYER_STATE_IDLE state.  | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| PLAYER_ERROR_PERMISSION_DENIED | Permission denied | 
| PLAYER_ERROR_NO_SUCH_FILE | File not found (Since 4.0) | 
| int player_set_subtitle_position_offset | ( | player_h | player, | 
| int | millisecond | ||
| ) | 
Sets the seek position for the subtitle.
| [in] | player | The handle to the media player | 
| [in] | millisecond | The position in milliseconds from the start to the seek point | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| int player_set_subtitle_updated_cb | ( | player_h | player, | 
| player_subtitle_updated_cb | callback, | ||
| void * | user_data | ||
| ) | 
Registers a callback function to be invoked when a subtitle updates.
| [in] | player | The handle to the media player | 
| [in] | callback | The callback function to register | 
| [in] | user_data | The user data to be passed to the callback function | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| int player_set_video_stream_changed_cb | ( | player_h | player, | 
| player_video_stream_changed_cb | callback, | ||
| void * | user_data | ||
| ) | 
Registers a callback function to be invoked when video stream is changed.
| [in] | player | The handle to the media player | 
| [in] | callback | The stream changed callback function to register | 
| [in] | user_data | The user data to be passed to the callback function | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| int player_unset_subtitle_updated_cb | ( | player_h | player | ) | 
Unregisters the callback function.
| [in] | player | The handle to the media player | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter | 
| PLAYER_ERROR_INVALID_OPERATION | Invalid operation | 
| int player_unset_video_stream_changed_cb | ( | player_h | player | ) | 
Unregisters the video stream changed callback function.
| [in] | player | The handle to the media player | 
0 on success, otherwise a negative error value | PLAYER_ERROR_NONE | Successful | 
| PLAYER_ERROR_INVALID_STATE | Invalid player state | 
| PLAYER_ERROR_INVALID_PARAMETER | Invalid parameter |