vimeo / vimeo.php

Official PHP library for the Vimeo API.
https://developer.vimeo.com
Apache License 2.0
448 stars 209 forks source link

Full guide on streaming uploads from the client to Vimeo with PHP/JS? #302

Closed Brugman closed 2 years ago

Brugman commented 2 years ago

Uploading videos

Upload or replace videos from the client

Streaming uploads

Streaming uploads support progress bars and resumable uploading. If you want to perform these uploads client-side, you need to start with some server-side requests.

Read through the Vimeo documentation first. Steps 1 and 4 should be performed on the server, while Steps 2 and 3 can be performed on the client. With this workflow, the video is never transferred to your servers.

Is there any guide anywhere that elaborates on this? Especially "steps 2 and 3 [..] on the client".

I have a standard PHP based post form upload working, using this composer package, and I'm looking to upgrade it to be all tus powered, resumable and fancy progress bar having.

I want to skip the webserver if at all possible, and upload directly from the client browser to Vimeo.

Ideally I'd like to do it all in PHP but that's looking less and less possible the more I search around. PHP with some vanilla JS is the next best thing, but I can't find a single example for this.

Alternatively I'm considering going full JS with Uppy + tus, but that project is not purpose built for Vimeo so I don't know if that'll be easy or a dead end.

Would love to hear your advise.

aaronm67 commented 2 years ago

There isn't a separate guide for doing this beyond what's available on the documentation site. tus-js-client will likely work as expected, though, other users have reported using it for Vimeo uploads.

Note that step 1 will likely need to happen server-side - most cases you will not want to expose your access token to the client.