Norman Perrin Norman Perrin - 1 year ago 90
Javascript Question

How to transform Uint8Array to .mp4 from AWS response

Hello fellow programmers.
I'm having a problem with transforming a response from AWS S3 to a .mp4 and then loading the content to a video tag.

The script:

var s3 = new AWS.S3({
endpoint: '...',
accessKeyId: "...",
secretAccessKey: "...",
region: '...',

Bucket: "...",
Key: "video.mp4"
function (err, data) {
if (err) {
console.log("[VideoPlay | ERROR | fallo del get]: " + err);
} else {
var video = document.getElementById('video');
var source = document.createElement('source');
var content = new Blob([new Uint8Array(data)], { type: "video/mp4" });
var url = (window.URL || window.webkitURL).createObjectURL(content);
source.setAttribute('src', url);

The error: 416 (Requested Range Not Satisfiable)


Answer Source

Finally I was uploading the file incorrectly. Here is the "get": get link

And here is the upload: upload link

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download