Examples +
- caption upload
- caption list
- caption languages
getCaptionLanguagestop
Description
Returns the distinct ISO 639-1 language codes for which the asset has
at least one caption file. Intended for tooltip / chip displays.
Fails with a SoapFault (ValidationErrorMessageList, field "assetId") if
the asset does not exist.
StringList getCaptionLanguages(int $asset_id)
Parameters
| int | $asset_id |
Return Values
| StringList |
Faults
getCaptionListtop
Description
Lists every caption file attached to the asset.
Captions are immutable and have no delete method; the list shrinks only
when the parent asset is deleted (ON DELETE CASCADE). Fails with a
SoapFault (ValidationErrorMessageList, field "assetId") if the asset does
not exist.
CaptionList getCaptionList(int $asset_id)
Parameters
| int | $asset_id |
Return Values
| CaptionList |
Faults
logintop
Description
Initializes a new session with given information
boolean login(string $user, string $pass, int $network)
Parameters
| string | $user | Username |
| string | $pass | Password |
| int | $network | $network Network ID |
Return Values
| boolean | true on success, false on fail |
logouttop
Description
Destroys the active session, logging out the user.
boolean logout()
Return Values
| boolean | true on success, false on fail |
uploadCaptionFiletop
Description
Uploads a closed-caption file for the given asset.
The file format (SRT, VTT, TTML) is derived from the extension of
$originalFileName. $assetId may reference a video OR an audio asset.
Captions are immutable: re-uploading the same (asset, language, format)
triple is rejected.
On any of the following the call fails with a SoapFault whose default
detail is a ValidationErrorMessageList (field => message):
- assetId: asset does not exist
- assetId: asset is already attached to a banner (captions must be
uploaded before the asset is bound)
- assetId: asset is neither a video nor an audio asset
- file: base64 content could not be decoded
- file: unsupported extension (only .srt, .vtt, .ttml allowed)
- file: MIME type does not match the extension
- file: file exceeds the 10 MB limit (CaptionFileValidator::MAX_BYTE_SIZE)
- languageCode: not a supported ISO 639-1 code
- languageCode: duplicate caption for this asset, language and format
int uploadCaptionFile(int $asset_id, string $base64_encoded_file_content, string $original_file_name, string $language_code)
Parameters
| int | $asset_id | $assetId video or audio asset id |
| string | $base64_encoded_file_content | |
| string | $original_file_name | Caption format is derived from this extension |
| string | $language_code | ISO 639-1 - Examples: "en", "de", "en-US", "de-DE" |
Return Values
| int | caption ID |
Faults
Captiontop
Definition
- - int $id
-
required
- - int $assetId
-
required
- - string $languageCode
-
required
- - string $format
-
required
- - string $fileName
-
required
- - string $originalFileName
-
required
- - string $createdAt
-
required
CaptionListtop
Definition
- - Array <Caption> $captionFiles
-
optional
- - Array <NamedStringValue> $lastKeySet
-
optional
NamedStringValuetop
Definition
- - string $name
-
required
- - string $value
-
required
StringListtop
Definition
- - Array <string> $strings
-
optional
The strings
ValidationErrorMessagetop
Definition
- - string $identifier
-
required
- - Array <string> $messages
-
required