HTTP method and endpoint
|
values: YOUR_TOKEN_WITHOUT_ANY_PREFIX
This will be a JWT token generate using VideoSDK ApiKey and Secret.
Note that the token will not include any prefix such as "Basic " or "Bearer ". Just pass a token as value.
You can generate a new token by refering this Guide: Generate Auth token
values: application/json
This is usefull for json body parameters, so that VideoSDK servers can understand that the incoming body parameter will be a JSON string.
Specifies height for the thumbnail which is to be captured default values for width and height | quality | orientation | width(default) | height(default) | :---: | :---: | :---: | :---: | | high | landscape | 1920 | 1080 | | med | landscape | 1280 | 720 | | low | landscape | 854 | 480 | | high | portrait | 1080 | 1920 | | med | portrait | 720 | 1280 | | low | portrait | 480 | 854 |
import fetch from 'node-fetch';
const options = {
method: "POST",
headers: {
"Authorization": "$YOUR_TOKEN",
"Content-Type": "application/json",
},
body: JSON.stringify({
"roomId" : "abcd-abcd-abcd",
"time" : "1",
"width" : "see example",
"height" : "see example",
"format" : "jpg"
}),
};
const url= `https://api.videosdk.live/v2/hls/capture`;
const response = await fetch(url, options);
const data = await response.json();
console.log(data);
{
"message": "captured thumbnail successfully",
"roomId": "abcd-abcd-abcd",
"meta": {
"createdAt": "2023-10-19T07:24:55.195Z",
"width": 1280,
"height": 720,
"format": "jpg"
},
"filePath": "<cdn url>",
"fileSize": 415153,
"fileName": "<filename>"
}
Got a Question? Ask us on discord