-
Notifications
You must be signed in to change notification settings - Fork 3
OcIngest
This class contains all REST API calls to the /ingest
endpoint.
It is accessible under OpencastApi\Rest
namespace.
- In
OpencastApi\OpenCast
as its property with OpenCast properties naming convention:
use OpencastApi\OpenCast;
$opencastApi = new OpenCast($config);
$ocIngest = $opencastApi->ingest;
...
- Direct instantiation:
use OpencastApi\Rest\OcRestClient;
use OpencastApi\Rest\OcIngest;
$ocRestClient = new OcRestClient($config);
$ocIngest = new OcIngest($ocRestClient);
...
Consumable functions are liested below:
Create an empty media package. More Detail
- Returns an array:
['code' => 200, 'body' => '{XML (text) media package}']
Add a metadata catalog to a given media package using an input stream. More Detail
-
$mediaPackage
(string) The media package. -
$flavor
(string) The kind of media catalog. -
$file
(file stream object) The metadata catalog file. -
$tags
(string) (optional) The tags of the attachment (From v1.3.0) -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add a metadata catalog to a given media package using an URL. More Detail
-
$mediaPackage
(string) The media package. -
$flavor
(string) The kind of media catalog. -
$url
(string) The location of the catalog. -
$tags
(string) (optional) The tags of the attachment (From v1.3.0) -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add a dublincore episode catalog to a given media package. More Detail
-
$mediaPackage
(string) The media package. -
$dublinCore
(string) DublinCore catalog. -
$flavor
(string) (optional) DublinCore Flavor (Default value=dublincore/episode) -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add an attachment to a given media package using an input stream. More Detail
-
$mediaPackage
(string) The media package. -
$flavor
(string) The kind of attachment. -
$file
(object) The attachment file. -
$tags
(string) (optional) The tags of the attachment (From v1.3.0) -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add an attachment to a given media package using an URL. More Detail
-
$mediaPackage
(string) The media package. -
$flavor
(string) The kind of attachment. -
$url
(string) The location of the attachment. -
$tags
(string) (optional) The tags of the attachment (From v1.3.0) -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Create and ingest media package from media tracks with additional Dublin Core metadata. It is mandatory to set a title for the recording. This can be done with the 'title' form field or by supplying a DC catalog with a title included. More Detail
-
$flavor
(string) (optional) The kind of media track. This has to be specified prior to each media track (default: "presenter/source"). -
$file
(string) (partially optional) media track file, could be null if mediaUri in $params is defined. -
$params
is an optional array that could contain the following:
[
'abstract' => '', // Episode metadata value.
'accessRights' => '', // Episode metadata value.
'available' => '', // Episode metadata value.
'contributor' => '', // Episode metadata value.
'coverage' => '', // Episode metadata value.
'created' => '', // Episode metadata value.
'creator' => '', // Episode metadata value.
'date' => '', // Episode metadata value.
'description' => '', // Episode metadata value.
'extent' => '', // Episode metadata value.
'format' => '', // Episode metadata value.
'identifier' => '', // Episode metadata value.
'isPartOf' => '', // Episode metadata value.
'isReferencedBy' => '', // Episode metadata value.
'isReplacedBy' => '', // Episode metadata value.
'language' => '', // Episode metadata value.
'license' => '', // Episode metadata value.
'publisher' => '', // Episode metadata value.
'relation' => '', // Episode metadata value.
'replaces' => '', // Episode metadata value.
'rights' => '', // Episode metadata value.
'rightsHolder' => '', // Episode metadata value.
'source' => '', // Episode metadata value.
'spatial' => '', // Episode metadata value.
'subject' => '', // Episode metadata value.
'temporal' => '', // Episode metadata value.
'temporal' => '', // Episode metadata value.
'title' => '', // Episode metadata value.
'type' => '', // Episode metadata value.
'episodeDCCatalogUri' => '', // URL of episode DublinCore Catalog.
'episodeDCCatalog' => '', // URL of episode DublinCore Catalog.
'seriesDCCatalogUri' => '', // URL of series DublinCore Catalog
'seriesDCCatalog' => '', // Series DublinCore Catalog
'acl' => '', // Access control list in XACML or JSON form
'tag' => '', // Tag of the next media file
'mediaUri' => '', // URL of a media track file
]
-
$wdID
(string) (optional) Workflow definition id. -
Returns an array:
['code' => 200, 'body' => '{Ingest successful. Returns workflow instance as XML (text)']
Create media package from a compressed file containing a manifest.xml document and all media tracks, metadata catalogs and attachments. More Detail
-
$zipFile
(object) The compressed (application/zip) media package file. -
$workflowDefinitionId
(string) Workflow definition id. -
$workflowInstanceId
(string) (optional) The workflow instance ID to associate with this zipped mediapackage. -
Returns an array:
['code' => 200, 'reason' => 'OK'] (The zipped media package is uploaded)
Create an empty media package with ID. Overrides Existing Mediapackage. More Detail
-
$id
(string) The Id for the new Mediapackage. -
Returns an array:
['code' => 200, 'body' => '{XML (text) media package}']
Discard a media package. More Detail
-
$mediaPackage
(string) Given media package to be destroyed. -
Returns an array:
['code' => 200, 'reason' => 'OK']
Add a partial media track to a given media package using an input stream. More Detail
-
$mediaPackage
(string) The XML media package as string. -
$flavor
(string) The kind of media track. -
$file
(object) The media track file. -
$startTime
(int) The start time in milliseconds. -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add a partial media track to a given media package using an URL. More Detail
-
$mediaPackage
(string) The XML media package as string. -
$flavor
(string) The kind of media track. -
$url
(string) The location of the media. -
$startTime
(int) The start time in milliseconds. -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add a media track to a given media package using an input stream. More Detail
-
$mediaPackage
(string) The XML media package as string. -
$flavor
(string) The kind of media track. -
$file
(object) The media track file. -
$tags
(string) (optional) The Tags of the media track. -
$progressCallable
(callable) (optional) Defines a function to invoke when transfer progress is made. The function accepts the following positional arguments:
function (
$downloadTotal: the total number of bytes expected to be downloaded, zero if unknown,
$downloadedBytes: the number of bytes downloaded so far,
$uploadTotal: the total number of bytes expected to be uploaded,
$uploadedBytes: the number of bytes uploaded so far
)
- Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
Add a media track to a given media package using an URL. More Detail
-
$mediaPackage
(string) The XML media package as string. -
$flavor
(string) The kind of media track. -
$url
(string) The location of the media. -
$tags
(string) (optional) The Tags of the media track. -
Returns an array:
['code' => 200, 'body' => '{XML (text) augmented media package}']
ingest($mediaPackage, $workflowDefinitionId = '', $workflowInstanceId = '', $workflowConfiguration = [])
Ingest the completed media package into the system. NOTE: In addition to the documented form parameters, workflow parameters are accepted as well. More Detail
-
$mediaPackage
(string) The media package. -
$workflowDefinitionId
(string) (optional) Workflow definition id. -
$workflowInstanceId
(string) (optional) The workflow instance ID to associate this ingest with scheduled events. -
$workflowConfiguration
(array) (optional) Workflow configuration parameters in ['key' => 'value'] format (from v1.7). -
Returns an array:
['code' => 200, 'body' => '{XML (text) media package}']
Schedule an event based on the given media package. More Detail
-
$mediaPackage
(string) The media package. -
$workflowDefinitionId
(string) (optional) Workflow definition id. -
Returns an array:
['code' => 201, 'reason' => 'Created'] (Event scheduled)