Resource management
Managing Videos
After you've succesfully authenticated and instantiated an instance of the Editframe
class, you can access previously created videos.
Video properties
Property | Type | Value |
---|---|---|
id | string | The video's ID |
isFailed | boolean | Whether video encoding failed |
isReady | boolean | Whether video encoding succeeded |
downloadUrl | string | URL to download the video from |
timestamp | number | Unix timestamp representing when the video was encoded |
streamUrl | string | URL to stream the video from |
thumbnailUrl | string | URL for the video's thumbnail image |
metadata | object | Arbitrary metadata |
Fetch all videos
editframe.videos.all()
signature
async function all(page?: number, perPage?: number): Promise<Video[]>;
Example
const videos = await editframe.videos.all();
[
{
"id": "6jx24gqZW7",
"isFailed": false,
"isReady": true,
"downloadUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/download?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"timestamp": 1652804118,
"streamUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/stream?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"thumbnailUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/thumbnail?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"metadata": {
"myAppId": 1
}
},
{
"id": "yKOqd7QnJZ",
"isFailed": true,
"isReady": false,
"metadata": {
"myAppId": 1
}
}
]
Fetch a single video
editframe.videos.get()
signature
async function get(id: string): Promise<Video | undefined>;
Example
const video = await editframe.videos.get("6jx24gqZW7");
{
"id": "6jx24gqZW7",
"isFailed": false,
"isReady": true,
"downloadUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/download?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"timestamp": 1652804118,
"streamUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/stream?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"thumbnailUrl": "https://api.editframe.com/v2/videos/6jx24gqZW7/thumbnail?client_id=mCEKwLSfNZzhyKOqd7QnJZ",
"metadata": {
"myAppId": 1
}
}