Manage videos
The Resources.Video
class provides methods to manage the videos you’ve uploaded to the platform.
Methods
Retrieve video information
Description: This method retrieves information about the specified video.
Function signature and example:
Parameters:
Return value: Returns a Promise
that resolves to a Models.Video
instance.
API Reference: For a description of each field in the request and response, see the Retrieve video information page.
List videos with direct pagination
Description: This method returns a paginated list of the videos in the specified index based on the provided parameters. Choose this method mainly when the total number of items is manageable, or you must fetch a single page of results. By default, the platform returns your videos sorted by their upload date, with the newest at the top of the list.
Function signature and example:
Parameters:
The ListVideoParams
interface extends the PageOptions
interface and defines the parameters for listing videos:
The following properties are inherited from the PageOptions
interface:
Return value: Returns a Promise
that resolves to an array of Models.Video
instances.
API Reference: For a description of each field in the request and response, see the List videos page.
Related guides:
List videos with iterative pagination
Description: This method iterates through a paginated list of the videos in the specified index based on the provided parameters. Choose this method mainly when your application must retrieve a large number of items. By default, the API returns your videos sorted by creation date, with the newest at the top of the list.
Function signature and example:
Parameters:
The ListVideoParams
interface extends the PageOptions
interface and defines the parameters for listing videos:
The following properties are inherited from the PageOptions
interface:
Return value: Returns a Promise
that resolves to an array of VideoListWithPagination
instances.
Note
To retrieve subsequent pages of results, use the async iterator protocol:
- Invoke the
next
method of theVideoListWithPagination
object. - Repeat this call until the method returns a promise that resolves to
null
, indicating no more pages exist.
API Reference: For a description of each field in the request and response, see the List videos page.
Related guides:
Update video information
Description: This method updates the title and the metadata of a video.
Function signature and example:
Parameters:
The UpdateVideoParams
interface defines the parameters for updating a video’s information:
Return value: Returns a Promise
that resolves to void
.
API Reference: For a description of each field in the request, see the Update video information page.
Delete video information
Description: This method deletes all the information about the specified video. This action cannot be undone.
Function signature and example:
Parameters:
Return value: Returns a Promise
that resolves to void
.
API Reference: Delete video information.