Creates a VodApi instance.
Options for the API client.
Requests for an asset to be exported from the Livepeer API to any external location, most commonly to IPFS.
the ID of the asset to be exported.
the export task parameters. Set ipfs
field to export to
IPFS and the optional nftMetadata
sub-field to customize the NFT metadata.
the export task
object that can be used to track progress and
wait for the output (check getTask).
Gets an asset from the API by ID.
the ID of the asset to fetch
the asset object as returned by the API.
Gets a task from the API by ID.
the ID of the task to fetch
the task object as returned by the API.
This is used to request a direct upload URL for a file to be uploaded to the API.
the name of the asset that will be created for the file in the API.
An object with the url
, and created asset
and task
. The
url
is the one that should be used to upload the file directly through
uploadFile. The asset
and task
are the ones created for the
file, which will get processed as soon as the contents are uploaded to the
url
. Check getTask to track task progress.
Requests for an asset stored in the Livepeer API to be transcoded to a different video profile.
the ID of the input asset to be transcoded.
the name of the output asset to be created.
descripiton of the desired video profile for the output asset.
This is used to upload a file to a direct upload URL obtained from the requestUploadUrl method.
The url returned by requestUploadUrl.
The content of the file to upload. A File
from the browser
or a ReadableStream
from node.js.
An optional callback that will be called with the upload progress, useful for giving some UI feedback to users. This is currently only supported from the browser.
An optional mimeType
for the file. Defaults to
octet-stream
and exact type will be detected automatically later.
A promise that will be completed when the upload is done. Will
throw an exception on any error. Refer back to the asset
and task
objects returned by requestUploadUrl for updates on the file
processing.
Generated using TypeDoc
Simplified client to the Livepeer API, exposing only the VOD endpoints.
This class can be used directly to make requests to the VOD API of Livepeer. In the most common case you should be using the {@link VideoNft} class instead for higher level utilities for uploading, processing and minting video files.