diff --git a/lib/Brightcove/API/Request/IngestRequest.php b/lib/Brightcove/API/Request/IngestRequest.php index ae32dc6..8867744 100644 --- a/lib/Brightcove/API/Request/IngestRequest.php +++ b/lib/Brightcove/API/Request/IngestRequest.php @@ -46,6 +46,11 @@ class IngestRequest extends ObjectBase { */ protected $text_tracks; + /** + * @var IngestTranscriptions[] + */ + protected $transcriptions; + public function __construct() { $this->fieldAliases["capture_images"] = "capture-images"; } @@ -68,6 +73,7 @@ public function applyJSON(array $json) { $this->applyProperty($json, 'thumbnail'); $this->applyProperty($json, 'capture_images'); $this->applyProperty($json, 'text_tracks', NULL, IngestTextTrack::class, TRUE); + $this->applyProperty($json, 'transcriptions', NULL, IngestTranscriptions::class, TRUE); } /** @@ -188,4 +194,21 @@ public function setTextTracks(array $text_tracks) { $this->fieldChanged('text_tracks'); return $this; } + + /** + * @return IngestTranscriptions[] + */ + public function getTranscriptions() { + return $this->transcriptions; + } + + /** + * @param IngestTranscriptions[] $transcriptions + * @return IngestRequest + */ + public function setTranscriptions(array $transcriptions) { + $this->transcriptions = $transcriptions; + $this->fieldChanged('transcriptions'); + return $this; + } } diff --git a/lib/Brightcove/API/Request/IngestTranscriptions.php b/lib/Brightcove/API/Request/IngestTranscriptions.php new file mode 100644 index 0000000..e781cd3 --- /dev/null +++ b/lib/Brightcove/API/Request/IngestTranscriptions.php @@ -0,0 +1,182 @@ +applyProperty($json, 'url'); + $this->applyProperty($json, 'srclang'); + $this->applyProperty($json, 'label'); + $this->applyProperty($json, 'kind'); + $this->applyProperty($json, 'default'); + $this->applyProperty($json, 'autodetect'); + $this->applyProperty($json, 'status'); + } + + /** + * @return string + */ + public function getUrl() { + return $this->url; + } + + /** + * @param string $url + * @return IngestTranscriptions + */ + public function setUrl($url) { + $this->url = $url; + $this->fieldChanged('url'); + return $this; + } + + /** + * @return string + */ + public function getSrclang() { + return $this->srclang; + } + + /** + * @param string $srclang + * @return IngestTranscriptions + */ + public function setSrclang($srclang) { + $this->srclang = $srclang; + $this->fieldChanged('srclang'); + return $this; + } + + /** + * @return string + */ + public function getLabel() { + return $this->label; + } + + /** + * @param string $label + * @return IngestTranscriptions + */ + public function setLabel($label) { + $this->label = $label; + $this->fieldChanged('label'); + return $this; + } + + /** + * @return string + */ + public function getKind() { + return $this->kind; + } + + /** + * @param string $kind + * @return IngestTranscriptions + */ + public function setKind($kind) { + $this->kind = $kind; + $this->fieldChanged('kind'); + return $this; + } + + /** + * @return boolean + */ + public function isDefault() { + return $this->default; + } + + /** + * @param boolean $default + * @return IngestTranscriptions + */ + public function setDefault($default) { + $this->default = $default; + $this->fieldChanged('default'); + return $this; + } + + /** + * @return boolean + */ + public function isAutoDetect() { + return $this->autodetect; + } + + /** + * @param boolean $autodetect + * @return IngestTranscriptions + */ + public function setAutoDetect($autodetect) { + $this->autodetect = $autodetect; + $this->fieldChanged('autodetect'); + return $this; + } + + /** + * @return string + */ + public function getStatus() { + return $this->status; + } + + /** + * @param string $status + * @return IngestTranscriptions + */ + public function setStatus($status) { + $this->status = $status; + $this->fieldChanged('status'); + return $this; + } + +} diff --git a/lib/Brightcove/Item/Video/TextTrack.php b/lib/Brightcove/Item/Video/TextTrack.php index 7eab64a..8f64d43 100644 --- a/lib/Brightcove/Item/Video/TextTrack.php +++ b/lib/Brightcove/Item/Video/TextTrack.php @@ -57,6 +57,11 @@ class TextTrack extends ObjectBase { */ protected $default; + /** + * @var string + */ + protected $status; + public function applyJSON(array $json) { parent::applyJSON($json); $this->applyProperty($json, 'id'); @@ -68,6 +73,7 @@ public function applyJSON(array $json) { $this->applyProperty($json, 'asset_id'); $this->applyProperty($json, 'sources', NULL, TextTrackSource::class, TRUE); $this->applyProperty($json, 'default'); + $this->applyProperty($json, 'status'); } /** @@ -222,4 +228,21 @@ public function setDefault($default) { $this->fieldChanged('default'); return $this; } + + /** + * @return string + */ + public function getStatus() { + return $this->status; + } + + /** + * @param string $status + * @return TextTrack + */ + public function setStatus($status) { + $this->status = $status; + $this->fieldChanged('status'); + return $this; + } } diff --git a/lib/Brightcove/Item/Video/Transcription.php b/lib/Brightcove/Item/Video/Transcription.php new file mode 100644 index 0000000..9b17d5f --- /dev/null +++ b/lib/Brightcove/Item/Video/Transcription.php @@ -0,0 +1,179 @@ +applyProperty($json, 'id'); + $this->applyProperty($json, 'src'); + $this->applyProperty($json, 'srclang'); + $this->applyProperty($json, 'label'); + $this->applyProperty($json, 'kind'); + $this->applyProperty($json, 'default'); + $this->applyProperty($json, 'autodetect'); + } + + /** + * @return string + */ + public function getId() { + return $this->id; + } + + /** + * @param string $id + * @return Transcription + */ + public function setId($id) { + $this->id = $id; + $this->fieldChanged('id'); + return $this; + } + + /** + * @return string + */ + public function getSrc() { + return $this->src; + } + + /** + * @param string $src + * @return Transcription + */ + public function setSrc($src) { + $this->src = $src; + $this->fieldChanged('src'); + return $this; + } + + /** + * @return string + */ + public function getSrclang() { + return $this->srclang; + } + + /** + * @param string $srclang + * @return Transcription + */ + public function setSrclang($srclang) { + $this->srclang = $srclang; + $this->fieldChanged('srclang'); + return $this; + } + + /** + * @return string + */ + public function getLabel() { + return $this->label; + } + + /** + * @param string $label + * @return Transcription + */ + public function setLabel($label) { + $this->label = $label; + $this->fieldChanged('label'); + return $this; + } + + /** + * @return string + */ + public function getKind() { + return $this->kind; + } + + /** + * @param string $kind + * @return Transcription + */ + public function setKind($kind) { + $this->kind = $kind; + $this->fieldChanged('kind'); + return $this; + } + + /** + * @return boolean + */ + public function isDefault() { + return $this->default; + } + + /** + * @param boolean $default + * @return Transcription + */ + public function setDefault($default) { + $this->default = $default; + $this->fieldChanged('default'); + return $this; + } + + /** + * @return boolean + */ + public function isAutoDetect() { + return $this->autodetect; + } + + /** + * @param boolean $autodetect + * @return Transcription + */ + public function setAutoDetect($autodetect) { + $this->autodetect = $autodetect; + $this->fieldChanged('autodetect'); + return $this; + } +} diff --git a/lib/Brightcove/Item/Video/Video.php b/lib/Brightcove/Item/Video/Video.php index 576ef94..78dabaa 100644 --- a/lib/Brightcove/Item/Video/Video.php +++ b/lib/Brightcove/Item/Video/Video.php @@ -142,6 +142,12 @@ class Video extends ObjectBase { * @var TextTrack[] */ protected $text_tracks; + /** + * Array of transcriptions objects. + * + * @var Transcription[] + */ + protected $transcriptions; /** * ISO 8601 date-time string * date-time video was last modified. @@ -187,6 +193,7 @@ public function applyJSON(array $json) { $this->applyProperty($json, 'state'); $this->applyProperty($json, 'tags'); $this->applyProperty($json, 'text_tracks', NULL, TextTrack::class, TRUE); + $this->applyProperty($json, 'transcriptions', NULL, Transcription::class, TRUE); $this->applyProperty($json, 'updated_at'); $this->applyProperty($json, 'projection'); $this->applyProperty($json, 'published_at'); @@ -549,6 +556,23 @@ public function setTextTracks(array $text_tracks) { return $this; } + /** + * @return Transcription[] + */ + public function getTranscriptions() { + return $this->transcriptions; + } + + /** + * @param Transcription[] $transcriptions + * @return $this + */ + public function setTranscriptions(array $transcriptions) { + $this->transcriptions = $transcriptions; + $this->fieldChanged('transcriptions'); + return $this; + } + /** * @return string */