我正在使用下面的代码来下载剪辑。我已成功收到回复,我正在尝试下载视频,但我无法下载。
const completeUrl = url + "/getClip";
const res = await client.post(completeUrl, params, {
headers: {
"Content-Type": "video/mp4",
"X-Amz-Target": "CodeBuild_20161006.StartBuild",
},
});
console.log("axios signedRquest is ", res);
var binaryData: any = [];
binaryData.push(res.data);
const downloadElement = document.createElement("a");
const href = window.URL.createObjectURL(
new Blob(binaryData, { type: contentType })
);
downloadElement.href = href;
downloadElement.download = "test.mp4";
document.body.appendChild(downloadElement);
downloadElement.click();
document.body.removeChild(downloadElement);
window.URL.revokeObjectURL(href);