Node-only: Opens the file at the given path for reading.
The full path of the file to open.
A fs.ReadStream
with the file contents.
Browser-only: Opens the file picker from the operating system for the user to select a video file to upload.
A promise that will be resolved with the File
that the
user picks in the file picker.
Uploads a file to the Livepeer API using a direct upload URL obtained via Api.requestUploadUrl.
The direct upload URL obtained via Api.requestUploadUrl.
The file contents to upload.
A promise that will be completed when the upload is done.
Node-only: Opens a file for reading and passes it to the given handler
,
closing the read stream as soon as the handler
is done.
The full path of the file to open.
A function that will be called with the fs.ReadStream
. If
it returns a promise, the file read stream will only be closed when the
promise is resolved.
The same value that was returned by the handler, maybe wrapped in a promise.
Generated using TypeDoc
Provides filesystem-access abstractions for the browser and node, and helpers for uploading them to the Livepeer API for creating the NFTs.
In the browser: you would typically use the pickFile method for opening a file picker and then uploadFile for sending the file contents to a URL obtained via Api.requestUploadUrl.
In node.js: you should use openFile or useFile instead, already passing the full path of the file that the user should have provided to your application somehow. After that, you can use the same uploadFile method to upload the file contents to the Livepeer API.