1

我正在使用可恢复的方法实现 Vimeo 视频上传Uppy Tus 所以首先我打电话给我的后端,并使用 Vimeo laravel 包,我正在创建视频,

$vimeoResponse = Vimeo::request('/me/videos', [
                                     'upload' => [
                                          'approach' => 'tus', 
                                          'size' => 26284326
                                      ]
                                ], 'POST');

在响应$vimeoResponse['body']['upload']['approach']tus符合预期。然后我将其发送$vimeoResponse['body']['upload']['upload_link']到我的前端。

在我的前端,我使用 Uppy tus 如下,

this.fileUploaderObject.use(UppyTus, {
     endpoint: this.uploadLink, // upload_link from backend
     resume: true,
     headers: {
         'Tus-Resumable': '1.0.0',
         'Upload-Offset': '0',
         'Content-Type': 'application/offset+octet-stream',
         'Accept': 'application/vnd.vimeo.*+json;version=3.4'
     },
     retryDelays: [0, 1000, 3000, 5000]
});

但是当我选择文件并开始上传时,我每次都会收到错误响应,

Failed to upload <filename> tus: unexpected response while creating upload, 
originated from request (method: POST, url: <upload_url>, 
response code: 412, response text: unsupported version

我试图在 Uppy Tus 配置中插入,但没有改变uploadUrl: this.uploadLinkendpoint: this.uploadLink

我尝试在 Uppy Tus 配置中插入,但出现 CORS 错误uploadUrl: this.uploadLinkendpoint: "https://asia-files.tus.vimeo.com/files/"

有人可以帮忙吗?

4

0 回答 0