| 
    Tizen Native API
    5.0
    
   
   | 
  
  
  
 
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) | 
| Sets a callback function to be invoked when a subtitle updates.   | |
| int | player_unset_subtitle_updated_cb (player_h player) | 
| Unsets the subtitle updated callback function.   | |
| int | player_set_subtitle_position_offset (player_h player, int milliseconds) | 
| Sets the seek position for the subtitle.   | |
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_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_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 | milliseconds | ||
| ) | 
Sets the seek position for the subtitle.
| [in] | player | The handle to the media player | 
| [in] | milliseconds | 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 | ||
| ) | 
Sets 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_unset_subtitle_updated_cb | ( | player_h | player | ) | 
Unsets the subtitle updated 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 |