TLP PHP5 library

Class

TlpApi\TlpApi

public class TlpApi

TlpApi class

Methods

void

__construct()

TlpApi Class constructor method

void

create_editor_url(string id, string lang, string authorId, string authorName, int authorConf, int expire)

Returns a valid URL link for calling TLP Player given input parameters.

void

ingest_new(string title, string id, string lang, array requested_langs, mixed mediaFile, array slidesFile, array attachmentFiles, date date)

Creates a Media Package in a temporal directory and sends it to /ingest API interface.

void

langs(string id)

Returns a list of subtitles and languages available for a given media ID in JSON format.

void

metadata(string id)

Returns metadata information of a given media ID in JSON format.

void

mod(string id, string lang, string authorId, string authorName, int authorConf, array mod)

Modifies the captions of a given media ID and language with the changes provided.

void

status(string upload_id)

Returns the status of an uploaded media in JSON format.

void

subs(string id, string lang, int format, int seg_filt_policy, int sel_data_policy)

Returns a subtitles file for a given media ID and language in different formats.

void

systems()

Returns a list with all available ASR, MT and TTS systems in JSON format.

void

uploadslist()

Returns a list with information of all uploaded media in JSON format.

Details

public void __construct()

TlpApi Class constructor method

public void create_editor_url(string id, string lang, string authorId, string authorName, int authorConf, int expire)

Returns a valid URL link for calling TLP Player given input parameters.

Parameters id - the ID of the media. lang - the language code of the captions. authorId - user name of user doing the changes. authorName - name of user doing the changes. authorConf - integer from 0 to 100 indicating the user confidence. expire - expire date of this URL in UNIX timestamp format.
public void ingest_new(string title, string id, string lang, array requested_langs, mixed mediaFile, array slidesFile, array attachmentFiles, date date)

Creates a Media Package in a temporal directory and sends it to /ingest API interface.

Parameters title - title of the media being ingested. id - ID media will have once ingested. lang - language code of the media audio. requested_langs - list of languages for which captions will be generated. mediaFile - DOLLAR_FILES PHP variable with uploaded media file or media file URL string. slidesFile - DOLLAR_FILES PHP variable with uploaded slides file (optional). attachmentFiles - DOLLAR_FILES PHP variable with multiple attachment files (optional). date - ingestion date in d/m/y format.
public void langs(string id)

Returns a list of subtitles and languages available for a given media ID in JSON format.

Parameters id - the ID of the media for which the API should return a list of available captions.
public void metadata(string id)

Returns metadata information of a given media ID in JSON format.

Parameters id - the ID of the media for which the API should return metadata information.
public void mod(string id, string lang, string authorId, string authorName, int authorConf, array mod)

Modifies the captions of a given media ID and language with the changes provided.

Parameters id - the ID of the media for which the API should modify the captions. lang - the language code of the captions. authorId - user name of user submitting the changes. authorName - name of user submitting the changes. authorConf - integer from 0 to 100 indicating the user confidence. mod - list of changes (check documentation)
public void status(string upload_id)

Returns the status of an uploaded media in JSON format.

Parameters upload_id - the ID of the uploaded media for which the API should return media status.
public void subs(string id, string lang, int format, int seg_filt_policy, int sel_data_policy)

Returns a subtitles file for a given media ID and language in different formats.

Parameters id - the ID of the media for which the API should return the captions. lang - the language code of the captions. format - the format ID of the captions (check documentation) seg_filt_policy - segment text filtering policy (check documentation) sel_data_policy - subtitle contents to be returned (check documentation)
public void systems()

Returns a list with all available ASR, MT and TTS systems in JSON format.

public void uploadslist()

Returns a list with information of all uploaded media in JSON format.