Video Archive docs
This page shows you the API calls required to implement our videos. The API requires a token which you can retrieve after creating a my.isset.video account.
Uploads are managed by the isset.video uploader. You can reach the uploader at https://upload.isset.video/upload.
Uploads require a third party library named Flow.js to manage chunks in the frontend. You can read more about this library here.
You can find an example below. Note how the download url in the downloadUrl function. This url can then be used to create new files in the Archive.
import Flow from '@flowjs/flow.js';
let videoInput = $('#publish-video-input');
let videoLabel = $('#publish-video-label');
let videoProgress = $('#publish-video-progress');
var flow = new Flow({
target: 'https://upload.isset.video/upload'
});
videoInput.change(function () {
let file = this.files[0];
if (file) {
videoLabel.html(file.name);
videoInput.attr('disabled', 'disabled');
submitButton.attr('disabled', 'disabled');
flow.addFile(file);
flow.upload();
} else {
videoLabel.html('');
}
});
flow.on('progress', (e) => {
let percentage = convertProgressToPercentage(flow.progress());
videoProgress.width(`${percentage}%`);
});
flow.on('fileSuccess', (file) => {
const url = downloadUrl(file.uniqueIdentifier, file.name);
//Do something with the url here
});
function convertProgressToPercentage(progress) {
return Math.round(progress * 100);
}
function downloadUrl(identifier, filename) {
return `https://upload.isset.video/download/${identifier}/${encodeURI(filename)}`;
}
The following request is used to create a file in the Video Archive
POST https://archive.isset.video/api/files/create with the supplied x-auth-token in the header and the url and filename in the JSON body.
x-token-auth: your-token-here
Curl PHP example:
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => "https://archive.isset.video/files/create",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_POSTFIELDS =>"{\n \"url\": \"{your-url-here}\",\n \"filename\": \"example.mp4\"\n}",
CURLOPT_HTTPHEADER => array(
"x-token-auth: your-token-here",
"Content-Type: application/json"
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
This will result in the following response.
{
"uuid": "8238d7ee-4a6f-4742-9a8e-151ad7d69117",
"filename": "example.mp4",
"folder": "d118f22e-8a91-4278-9980-39d95178f8ab",
"date_created": "2020-03-18T10:30:03+01:00",
"size": null,
"duration": null,
"width": null,
"height": null,
"stills": [],
"preview": null,
"description": null,
}