I am trying to integrate the tus-server with shrine to upload the video files to Vimeo.
Client.js
this.uppy = new Uppy({
id: 'uppy1',
autoProceed: false,
debug: true,
restrictions: {
allowedFileTypes: ['.mp4'],
},
allowMultipleUploads: true,
})
.use(Tus, { endpoint: `${API_BASE}/files` })
/* .use(XHRUpload, { endpoint: `${API_BASE}/files`,
formData: true,
bundle: false,
fieldName: 'file',
headers: getHeaders(), */
})
.use(GoogleDrive, { serverUrl: 'https://companion.uppy.io' })
.use(Dropbox, { serverUrl: 'https://companion.uppy.io/' });
# config/routes.rb (Rails)
Rails.application.routes.draw do
mount Tus::Server => "/files"
end
Here, by default, the server directly uploads the file to the data/
folder with a file in the project root.
What I want to achieve is to upload the video
files to Vimeo.
Like:
- File goes to
${API_BASE}/files
- Mine controller gets the file
- I pass the file to Vimeo (using vimeo_me2)
- Vimeo uploads the file and sends the video_url back. I now insert the video_url in a certain video table.
- All these above processes need to be resumable.
I am using vimeo_me2 gem.
Can Anyone provide a solution to integrate/configure Tus server with Shrine?