Log In

Here an example of workflow to upload videos

You can upload videos in two different ways, depending from the file size of content you have.
If file is smaller than 32MB, you can directly do that with this single call: https://teyuto.readme.io/reference/uploadvideo-1

If file is larger, you need to do two steps:

  1. Generate the URL to upload the video [POST]
  2. Upload video on that URL [PUT]

It's mandatory specify the type and the size, this values needs to be coherent with the file you will upload or upload will fail.

Here an example of code:

let dataRequest = 'type=' + contentType + '&size=' + fileSize;
$.ajax({
  type: "POST",
  url: 'https://api.teyuto.tv/v2/videos/{idVideo}/signed', //create URL {"status" => "201", "signed_url" => "https://..."}
  data: dataRequest,
  cache: false,
  success: function (json) {
    let jsonParsed = JSON.parse(json);
    xhr.open("PUT", jsonParsed.signed_url); // PUT call on URL
    xhr.send(file);
  }
});