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 models.Video
object representing the retrieved video.
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:
Return value: Returns a RootModelList
containing models.Video
objects, representing the list of videos that match the specified criteria.
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:
Return value: Returns a models.VideoListWithPagination
object, containing the list of videos that match the specified criteria and pagination information.
Note
To retrieve subsequent pages of results, use the iterator protocol:
- Call the
next
function, passing theVideoListWithPagination
object as a parameter. - Repeat this call until a
StopIteration
exception occurs, 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 metadata of a video.
Function signature and example:
Parameters:
Return value: None
. The method doesn’t return any value.
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: None
. The method doesn’t return any value.
API Reference: Delete video information.