Creates a new Api
instance with the given API configuration.
The options to pass to the Livepeer API client.
Checks if the specified asset requires any special processing before being minted as an NFT.
The asset to check. It must have been fully populated with the video metadata, meaning that the Task that created it must have already completed.
The size limit to shrink the asset to. Defaults to 100MB.
An object with 2 fields possible
and desiredProfile
. The
possible
field is a boolean indicating if the asset can actually be
normalized or not, i.e. if there is any acceptable bitrate to reduce its
size below the sizeLimit
. The desiredProfile
field is the video profile
that should be used to transcode the asset, if possible
.
Utility for performing the full file upload process for creating an asset in the Livepeer API.
The name of the asset that will be created.
The content of the file to be uploaded.
A function that will be called periodically with the progress of the upload. Parts of it only work in the browser.
The newly created and already processed/populated Asset.
Exports an asset to decentralized storage (IPFS).
The ID of the asset to export.
The custom overrides for fields in the NFT metadata. You
can change the value of any field by specifying it here, or delete any
default field by specifying null
.
A function that will be called periodically with the progress of the export task.
The information about the files exported to IPFS. Use the
nftMetadataUrl
field as the tokenUri
for minting the NFT of the asset.
Normalizes the specified asset fot the best possible NFT.
The asset to normalize. It must have been fully populated with the video metadata, meaning that the Task that created it must have already completed.
A function that will be called periodically with the progress of the transcode task.
The size limit to shrink the asset to. Defaults to 100MB.
The new asset created with the normalized video spec.
Request a direct upload URL for a file to be uploaded to the API.
The name of the asset that will be created.
An object with the url
and created asset
and task
. The
asset
and task
can be used to track the progress of the upload (see
waitTask).
Wait until a specified task is completed.
The task object that should be waited for.
An optional callback to be called with the progress of the running task, which is a number for 0 to 1. Useful for showing some UI feedback to users.
The finished Task
object also containing the task output. Check
the output
field for the respective output depending on the task type
.
Generated using TypeDoc
Provides higher-level abstractions on top of the Livepeer VOD API focused on the NFT-minting process.
This class requires an API key to be used for calling the Livepeer API. As such, it is most appropriately used in a secure context like a backend server (even if only acting as a proxy). It can still be used from the browser with a CORS-enabled API key, but beware that the API key will be exposed for anyone that grabs it from your web page.