ElvClient/ABRPublishing

Methods for ABR video creation and management

For more information on how to publish ABR content see this detailed guide

Source:

Methods

static CreateABRMezzanine({
abrProfileoptional,
addlOfferingSpecsoptional,
descriptionoptional,
keepOtherStreamsoptional,
libraryId,
masterVersionHash,
metadataoptional,
name,
objectIdoptional,
offeringKeyoptional,
respLogLeveloptional,
structLogLeveloptional,
streamKeys,
typeoptional,
variantoptional
})
→ Object

Create (or edit) a mezzanine offering based on the a given master content object version and variant key

Returns: The finalize response for the object, as well as logs, warnings and errors from the mezzanine initialization
Parameters:
Name Type Attributes Default Description
abrProfile Object <optional>

Custom ABR profile. If not specified, the profile of the mezzanine library will be used

addlOfferingSpecs Object <optional>

Specs for additional offerings to create by patching the offering being created/edited

description string <optional>

Description for mezzanine content object

keepOtherStreams boolean <optional>
false

If objectId is specified, whether to preserve existing streams with keys other than the ones specified in production master

libraryId string

ID of the mezzanine library

masterVersionHash string

The version hash of the production master content object

metadata Object <optional>

Additional metadata for mezzanine content object

name string

Name for mezzanine content object

objectId string <optional>

ID of existing object (if not specified, new object will be created)

offeringKey string <optional>
default

The key of the offering to create

respLogLevel "warn" | "info" | "debug" <optional>
warn

The level of logging to return in http response

structLogLevel "none" | "error" | "warn" | "info" | "debug" <optional>
none

The level of logging to save to object metadata

streamKeys Array.<string>

List of stream keys from variant to include. If not supplied all streams will be included.

type string <optional>

ID or version hash of the content type for the mezzanine

variant string <optional>
default

What variant of the master content object to use

Example
async CreateABRMezzanine({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "masterVersionHash": "hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
  "type": "ABR Master",
  "name": "Mezzanine Test",
  "description": "Mezzanine Test Description",
  "metadata": {
    "test": "mezzanine"
  }
});


{
  "logs": [
    "2021-03-09 20:06:31 Debug: apiAbrMezzanineInit()",
    "2021-03-09 20:06:31 Info: Get abr.Profile from lib",
    "2021-03-09 20:06:31 Info: Get abr.Profile from lib metadata /abr_profile",
    "2021-03-09 20:06:31 Info: Get production.Master",
    "2021-03-09 20:06:31 Debug: getProductionVariantCtx(hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH,default)",
    "2021-03-09 20:06:31 Debug: getting production.Master: hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
    "2021-03-09 20:06:31 Debug: Get production.Variant 'default' from production.Master",
    "2021-03-09 20:06:31 Info: Generate abr.Offering",
    "2021-03-09 20:06:31 Info: Saving metadata"
  ],
  "warnings": [],
  "errors": [],
  "id": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "hash": "hq__36T8woJSLJoC7TfTqsRsME3wBcTTedb21UWkFB3L9seesLG7E86CXm8e7uCP9GfrihPfFwXp9M",
  "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLH9gYQEBDzxECpugP8g7Mp2",
  "type": "hq__J39WocoEB1hc19t3o1YUaZM2PAzhRvLck6NVmFFviSTRM5yvVTcJ4SJeULw3VarH6mD6xkfjaC",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static CreateProductionMaster({
libraryId,
typeoptional,
name,
descriptionoptional,
contentTypeName,
metadataoptional,
fileInfooptional,
encryptoptional,
copyoptional,
callbackoptional,
respLogLeveloptional,
structLogLeveloptional,
accessoptional
})
→ Object

Create a master media content object with the given files.

  • If uploading using local files, use fileInfo parameter (see UploadFiles for format)
  • If uploading from S3 bucket, use access, filePath and copy, parameters (see UploadFilesFromS3 method)
Returns: The finalize response for the object, as well as logs, warnings and errors from the master initialization
Parameters:
Name Type Attributes Default Description
libraryId string

ID of the library

type string <optional>

ID or version hash of the content type for this master

name string

Name of the content

description string <optional>

Description of the content

contentTypeName string

Name of the content type to use

metadata Object <optional>

Additional metadata for the content object

fileInfo Array.<Object> <optional>

Files to upload (See UploadFiles/UploadFilesFromS3 method)

encrypt boolean <optional>
true

(Local or copied files only) - Unless false is passed in explicitly, any uploaded/copied files will be stored encrypted

copy boolean <optional>
false

(S3) If specified, files will be copied from S3

callback function <optional>

Progress callback for file upload (See UploadFiles/UploadFilesFromS3 method)

respLogLevel "warn" | "info" | "debug" <optional>
warn

The level of logging to return in http response

structLogLevel "none" | "error" | "warn" | "info" | "debug" <optional>
none

The level of logging to save to object metadata

access Array.<Object> <optional>
[

Array of cloud credentials, along with path matching regex strings - Required if any files in the masters are cloud references (currently only AWS S3 is supported)

  • If this parameter is non-empty, all items in fileInfo are assumed to be items in cloud storage
  • Format: [
  •       {
    
  •         path_matchers: ["FILE_PATH_MATCH_REGEX_1", "FILE_PATH_MATCH_REGEX_2" ...],
    
  •         remote_access: {
    
  •           protocol: "s3",
    
  •           platform: "aws",
    
  •           path: "YOUR_AWS_S3_BUCKET_NAME" + "/",
    
  •           storage_endpoint: {
    
  •             region: "YOUR_AWS_REGION_NAME"
    
  •           },
    
  •           cloud_credentials: {
    
  •             access_key_id: "YOUR_AWS_S3_ACCESS_KEY",
    
  •             secret_access_key: "YOUR_AWS_S3_SECRET"
    
  •           }
    
  •         }
    
  •       },
    
  •       {
    
  •         path_matchers: [".*"], // <-- catch-all for any remaining unmatched items in fileInfo
    
  •         remote_access: {
    
  •           ...
    
  •         }
    
  •       },
    
  •       ...
    
  •     ]
    
  • The simplest case is a one element array with .path_matchers == [".*"], in which case the same credentials will be used for all items in fileInfo
Throws:

error - If the initialization of the master fails, error details can be found in error.body

Type
Object
Example
async CreateProductionMaster({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "type": "Production Master",
  "name": "Production Master Test",
  "description": "Production Master Test Description",
  "metadata": {
    "test": "master"
  },
  "fileInfo": [
    {
      "path": "Video.mp4",
      "mime_type": "video/mp4",
      "size": 3738907,
      "data": "<ArrayBuffer 3738907>"
    }
  ]
});


{
  "errors": [],
  "logs": [
    "2021-03-09 20:06:22 Debug: avtest.initProdMaster()",
    "2021-03-09 20:06:22 Info: Get list of files from object",
    "2021-03-09 20:06:22 Info: 2 item(s) found in file list.",
    "2021-03-09 20:06:22 Info: Skipping '.'",
    "2021-03-09 20:06:22 Info: Analyzing Video.mp4",
    "2021-03-09 20:06:22 Debug: getAvpReqCtx filePath=Video.mp4 qhot=tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA key=tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA.txAll.Video.mp4",
    "2021-03-09 20:06:22 Info: Successfully generated default variant"
  ],
  "warnings": [],
  "id": "iq__fQhR2f757MCYQ7SNrwKh39XeSPs",
  "hash": "hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
  "write_token": "tqw__HSRoazbriLdH7CGobx96kWaZqkqo2Z1x9Qru5h5n1FyhfX9W6FkWjBH3EikHKUoFLLq3Jf5ZLbTL2UJjFwA",
  "type": "hq__AsSK6q2Jh8vetffArMHiyMhEgQD4fyni1g5PgeBSPcKERMJv5hbuyAd3aNQTaeJD9ounyKTUEu",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static FinalizeABRMezzanine({
libraryId,
objectId,
writeToken,
offeringKeyoptional,
preFinalizeFnoptional,
preFinalizeThrowoptional
})
→ Promise.<Object>

Finalize a mezzanine object after all jobs have finished

Returns: The finalize response for the mezzanine object, as well as any logs, warnings and errors from the finalization
Parameters:
Name Type Attributes Default Description
libraryId string

ID of the mezzanine library

objectId string

ID of the mezzanine object

writeToken string

Write token for the mezzanine object

offeringKey string <optional>
default

The offering to process

preFinalizeFn function <optional>

A function to call before finalizing changes, to allow further modifications to offering. The function will be invoked with {elvClient, nodeUrl, writeToken} to allow access to the draft and MUST NOT finalize the draft.

preFinalizeThrow boolean <optional>

If set to true then any error thrown by preFinalizeFn will not be caught. Otherwise, any exception will be appended to the warnings array returned after finalization.

Example
async FinalizeABRMezzanine({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "offeringKey": "default"
});


{
  "logs": [
    "2021-03-09 20:07:22 Debug: getProductionVariantCtx(hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH,default)",
    "2021-03-09 20:07:22 Debug: getting production.Master: hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH",
    "2021-03-09 20:07:22 Debug: Get production.Variant 'default' from production.Master"
  ],
  "warnings": [],
  "errors": [],
  "id": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "hash": "hq__AXQrQWT8v1Xe784ciwaFJoXphaeoXHJzsG3JY8NHTsXZcZ18jqx6dPfqT8268c8Aoq5VnsmC3",
  "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
  "type": "hq__J39WocoEB1hc19t3o1YUaZM2PAzhRvLck6NVmFFviSTRM5yvVTcJ4SJeULw3VarH6mD6xkfjaC",
  "qlib_id": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV"
}
Source:

static LROStatus({
libraryId,
objectId,
offeringKeyoptional
})
→ Promise.<Object>

Retrieve status information for a long running operation (LRO) on the given object.

Returns: LRO status
Parameters:
Name Type Attributes Default Description
libraryId string

ID of the library

objectId string

ID of the object

offeringKey string <optional>
default

Offering key of the mezzanine

Examples
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "9ea07c9c-6f8a-41a0-b721-8fd7d72d82c8": {
    "duration": 0,
    "duration_ms": 0,
    "progress": {
      "percentage": 0
    },
    "run_state": "running",
    "start": "2021-03-09T20:06:39Z"
  },
  "c056f89b-53f3-4aac-8b83-bd996cd37baf": {
    "duration": 0,
    "duration_ms": 0,
    "progress": {
      "percentage": 0
    },
    "run_state": "running",
    "start": "2021-03-09T20:06:39Z"
  }
}
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "9ea07c9c-6f8a-41a0-b721-8fd7d72d82c8": {
    "duration": 0,
    "duration_ms": 0,
    "progress": {
      "percentage": 0
    },
    "run_state": "running",
    "start": "2021-03-09T20:06:39Z"
  },
  "c056f89b-53f3-4aac-8b83-bd996cd37baf": {
    "duration": 7676000000,
    "duration_ms": 7676,
    "end": "2021-03-09T20:06:46Z",
    "progress": {
      "percentage": 100
    },
    "run_state": "finished",
    "start": "2021-03-09T20:06:39Z"
  }
}
async LROStatus({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy"
});


{
  "9ea07c9c-6f8a-41a0-b721-8fd7d72d82c8": {
    "duration": 39242000000,
    "duration_ms": 39242,
    "end": "2021-03-09T20:07:18Z",
    "progress": {
      "percentage": 100
    },
    "run_state": "finished",
    "start": "2021-03-09T20:06:39Z"
  },
  "c056f89b-53f3-4aac-8b83-bd996cd37baf": {
    "duration": 7676000000,
    "duration_ms": 7676,
    "end": "2021-03-09T20:06:46Z",
    "progress": {
      "percentage": 100
    },
    "run_state": "finished",
    "start": "2021-03-09T20:06:39Z"
  }
}
Source:

static StartABRMezzanineJobs({
libraryId,
objectId,
offeringKeyoptional,
accessoptional,
jobIndexes
})
→ Promise.<Object>

Start any incomplete jobs on the specified mezzanine

Returns: A write token for the mezzanine object, as well as any logs, warnings and errors from the job initialization
Parameters:
Name Type Attributes Default Description
libraryId string

ID of the mezzanine library

objectId string

ID of the mezzanine object

offeringKey string <optional>
default

The offering to process

access Array.<Object> <optional>

Array of S3 credentials, along with path matching regexes - Required if any files in the masters are S3 references (See CreateProductionMaster method)

  • Format: {region, bucket, accessKey, secret}
jobIndexes Array.<number>

Array of LRO job indexes to start. LROs are listed in a map under metadata key /abr_mezzanine/offerings/(offeringKey)/mez_prep_specs/, and job indexes start with 0, corresponding to map keys in alphabetical order

Example
async StartABRMezzanineJobs({
  "libraryId": "ilib3JgZBNxZE8ZkM4jP8YUAdTnjukWV",
  "objectId": "iq__4Ym91uVyPhayTRsew3ixQ8aGDJjy",
  "offeringKey": "default"
});


{
  "lro_draft": {
    "write_token": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
    "node": "https://host-34-105-49-255.testv2.contentfabric.io/",
    "offering": "default"
  },
  "writeToken": "tqw__HSa7sjaqEvcqqzVzWXbKs3HYMrm2BiBqWMj228bGixxYn4ibq12Gr65QowfgLNBUX6qWhcPxkCyMnoAaHpW",
  "data": [
    "c056f89b-53f3-4aac-8b83-bd996cd37baf",
    "9ea07c9c-6f8a-41a0-b721-8fd7d72d82c8"
  ],
  "logs": [
    "2021-03-09 20:06:39 Debug: getAvpReqCtx filePath=Video.mp4 qhot=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH key=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH.txAudio.Video.mp4",
    "2021-03-09 20:06:39 Debug: getAvpReqCtx filePath=Video.mp4 qhot=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH key=hq__sknpjER8hAHks8JkJKujw1JwDHPRXodMX59FiHS6ZLxPPSQmD1tE6bpvRyTNxiez5x1LCQmEH.txVideo.Video.mp4"
  ],
  "warnings": [],
  "errors": []
}
Source: