Git Product home page Git Product logo

vimeo-upload's Introduction

╭───╮╭─╮  
│   ││ │╭─╮╭──┬──┬─╮╭───╮╭───╮   
│   ││ │├─┤│ ╭╮ ╭╮ ││ ─ ││╭╮ │  ╭────────┬─────────────────────╮
╰╮  ╰╯╭╯│ ││ ││ ││ ││  ─┤│╰╯ │  | UPLOAD │ ▒▒▒▒▒▒▒▒▒▒▒░░░░ %75 |                    
 ╰────╯ ╰─╯╰─╯╰─╯╰─╯╰───╯╰───╯  ╰────────┴─────────────────────╯                    

Build Status js-standard-style npm version Bower version GitHub forks GitHub stars Percentage of issues still open

Upload videos to your Vimeo account and update their metadata directly from a browser or a Node.js app.

Try it LIVE

Install

Using Bower

bower install vimeo-upload

Or npm

npm install vimeo-upload

Usage

Include vimeo-upload.js in your index.html.

<script src="bower_components/vimeo-upload/vimeo-upload.js"></script>

Create a new VimeoUpload initialized with a Blob or File and Vimeo Access Token then call upload() to start the upload process.

var uploader = new VimeoUpload({
  file: file,
  token: accessToken,
});

uploader.upload();

Your access token need to be authorized by Vimeo. Create new Vimeo access token here.

Check index.html for details and additional parameters you can include when initializing VimeoUpload.

Credits

Sample code for uploading files directly with XHR/CORS: cors-upload-sample

vimeo-upload's People

Contributors

andrestntx avatar benmcmaster avatar diegopscode avatar herkyl avatar jeffposnick avatar lumberjackchester avatar mikeprocopio avatar sadashivdalvi avatar samarrizvi avatar sqrrrl avatar websemantics avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vimeo-upload's Issues

privacy setting

hi, great library, works perfectly, however im not sure if this is vimeo upload or vimeo not applying global settings. When I set privacy to true it applies it but it sets the video to "me only" and not "hide from vimeo". Is there a way to set this? I did not see these options in the vimeo api docs.

Thanks for the great work

W

Progresse bar 0 on Edge

Hello upload is ok on Edge, but progress bar stay to 0%.

When upload is finished, progress bar go to 100%. Do you have any idea to solve this ?

this.buildUrl_ is not a function

Hello,

I am experiencing a problem using the library via Webpack. I can import it without any issue to my code, but when I try to upload a video it raises this error:

Uncaught TypeError: this.buildUrl_ is not a function at me (vimeo-upload.js:170)

My code is:

import VimeoUpload from 'vimeo-upload';

return VimeoUpload({ file: file, token: 'XXXXXXXX' }).upload();

Thank you ;)

Slow Vimeo upload speed using library compared to direct upload

I am using this library to upload videos from my web app to Vimeo. It is working fine. However, I need some assistance please in relation to the uploading speed. I have run two tests to determine why my implementation of the library is rather quite slow compared to uploading the same video directly onto the Vimeo Platform.

I observed a major thing which had me quite concerned and I just had to reach out for assistance. I observed that, when I opened my Task Manager in windows to observe the network performance, I can see that my upload using the library indicates that my upload speed is averaging/locking around 2Mbps while the upload directly is averaging around 20Mbps hence the upload directly on the Vimeo site is around 10 times faster.

I tried researching about this issue and the closest I got to an explanation is what one writer termed the size of the upload chunk. According to the writer, in their case, this problem was because the upload chunk was around 100Kb and the solution was just to change this size to make it bigger, say to 1Mb and the upload became faster. However, this was a whole different situation uploading to some other place, not Vimeo. Trying to look for the same situation in the library, I have realized that there doesn't seem to be any defined upload chunk size or its somewhere and I can't locate it.

My request is for you to kindly please assist me with tips and hints to make uploads from the library as fast as directly uploading to Vimeo.

Thank you for your assistance in advance.

Pull not Post

Is there a way to convert this (or have the option) to make your script Pull instead of Post? Working with the Wordpress media library I'll need to pull files. Thanks!

changing default configuration

please I cant seem to figure out how to change the default configurations like name, description and privacy. any help here please

XMLHttpRequest is not defined

0|CE Libra | 2017-08-08 09:05:06 -03:00: ReferenceError: XMLHttpRequest is not defined
0|CE Libra |     at me.upload (/srv/shared/backend/node_modules/vimeo-upload/vimeo-upload.js:193:23)
0|CE Libra |     at /srv/shared/backend/lib/importer/uploadVideo.js:22:45
0|CE Libra |     at Video.get link [as link] (/srv/shared/backend/lib/importer/uploadVideo.js:13:20)
0|CE Libra |     at Object.<anonymous> (/srv/shared/backend/lib/importer/uploadVideo.js:37:57)
0|CE Libra |     at Module._compile (module.js:570:32)
0|CE Libra |     at Module._compile (/srv/shared/backend/node_modules/async-to-gen/register.js:39:23)
0|CE Libra |     at Module._extensions..js (module.js:579:10)
0|CE Libra |     at Object.require.extensions.(anonymous function) [as .js] (/srv/shared/backend/node_modules/async-to-gen/register.js:42:5)
0|CE Libra |     at Module.load (module.js:487:32)
0|CE Libra |     at tryModuleLoad (module.js:446:12)
0|CE Libra |     at Function.Module._load (module.js:438:3)
0|CE Libra |     at Module.require (module.js:497:17)
0|CE Libra |     at require (internal/module.js:20:19)

Metadata issue: Although the upload succeeds, the onComplete handler is never called

This is true for your demo version as well as my implementation.

vimeo-upload's onGetMetadata_ takes the lack of a response (or more precisely, an empty string on the response) on the xhr target to be an indication that there has been a metadata upload error, and calls onCompletionError. But I don't see an expectation from Vimeo that a response will be returned, as the HTTP code is 204. The videos upload to Vimeo as expected, including the metadata.

Perhaps this is a Vimeo bug? The Vimeo documentation says that we should expect a 200 with a response in response to this PATCH call, and does not document a 204 response:
https://developer.vimeo.com/api/endpoints/videos

Running an equivalent PATCH call on the Vimeo playground does return a 200 with the video metadata as part of the response. I'm not sure whether vimeo-upload isn't setting up PATCH the call correctly, or whether Vimeo isn't responding to it in the way that they document.

I've patched my vimeo-upload to treat a 204 as a success, although I don't think that's a long term solution. Any insight into what is going on here?

Suggestion: User the uploader without token

One thing that kept me from using vimeo-upload is that I would have to expose my access token which does not seem like a good idea since it seems to me that it can more easily be used for other unintended purposes.

However, aside from that the functionality provided is indeed very useful and as such I just wanted to make the suggestion that a possible extension would be to enable you to use it with a vimeo upload_link_secure instead of a token. This would enable a webdev to request the upload url in the server side, keep the token hidden and just pass the upload url for the vimeo-upload (on the frontend side). I think this would just skip some steps in the code already implemented.

Just a suggestion!

Cordova: Upload with file url

I want to integrate Vimeo upload in the Cordova/Ionic v1 project.
I have URL of the video.Can I upload to Vimeo with that?

Do anyone has any demo of how to integrate Vimeo upload with Cordova video URL.

Error: Not Found

It worked until yesterday, When trying to upload a video. the plugin fails.
captura de pantalla 2017-09-18 a la s 19 18 42

403 error

Hi, thanks for developing this, integration is easy, however on my test site and yours i get a 403 error "PATCH https://api.vimeo.com/videos/226313911 403 (Forbidden)" the video is uploading using my token but the complete function is not fired. I also noticed the title and description are also not being added so each video is "untitled" ideally i need the Vimeo id back to store but it seems something in the js file is not returning or something in my api set up on Vimeo is wrong? My Vimeo Default API Version is is 3.2

Thanks

Wayne

handleFileSelect Does not automatically called

Hi Developers,

i am working with sample application which consists uploading a video using vimeo and retrieving it. I used that index.html file and Vimeo-upload.JS file into my application.i can successfully bring the view into my app.when i browse the file..No api is calling automatically. whereas in the github link when I upload the video, API automatically calls. can you please tell me what i am doing wrong.

onContentUploadError_ handler for Request header field X-Upload-Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.

I'm having an intermittent error on the uploader when trying upload videos. There are times that I got this error on console.

PUT https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1 net::ERR_CONNECTION_RESET
first.js:22460 XHR failed loading: PUT "https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1".

me.sendFile_ @ first.js:22460
(anonymous) @ first.js:22416

This results to numerous request on vimeo, ending up with 429 error on Vimeo related to rate limits.

XMLHttpRequest cannot load https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1. Request header field X-Upload-Content-Type is not allowed by Access-Control-Allow-Headers in preflight response.
first.js:22478 XHR failed loading: PUT "https://1512364271.cloud.vimeo.com/upload?ticket_id=cedf9e8b71b28c5e1825b2d…66&video_file_id=803367585&signature=92253552173556f613ef26f17c9df4bb&v6=1".
me.resume_ @ first.js:22478
me.onContentUploadError_ @ first.js:22610

After series of debugs, I found that the error was triggered within the onContentUploadError handler. It falls within the retryHandler which causes an infinite loop.

/** * Handles errors for uploads. Either retries or aborts depending * on the error. * * @private * @param {object} e XHR event */ me.prototype.onContentUploadError_ = function(e) { if (e.target.status && e.target.status < 500) { this.onError(e.target.response) } else { this.retryHandler.retry(this.resume_()) } }

Any suggestions on how to fix this issue? Thank you in advance.

ERR_CONNECTION_RESET, When will upload via chunks be available?

Unsure if the two are related, however on some computers I'm getting an ERROR_CONNECTION_RESET while uploading videos that are greater than 2-3G via Chrome.

There is a way to fix this via Chrome, however it's not very user-friendly since I'm looking to create a video uploader for video contributors to my channel.

When will the upload via chunks be available ? Would be nice to catch this error and switch to upload via chunks?

Thanks !

Upload tags

Is it possible to upload the video with tags along with the title and description

Incorrect privacy.view status

Please fix the value for private mode here:
'privacy.view': opts.private ? 'unlisted' : 'anybody' (line 165)

The correct value for private mode is 'nobody'.

P.s. thanks a lot for your plugin!

Suggestions: Allow custom privacy settings

I think it would be really helpful to allow more than just 1 privacy setting (private or anybody). So why not expose the "privacy" parameter as an argument? There are some videos that I would like to be unlisted, for example, not just private.

Upload Error

The video I tried to upload is successfully uploading but onComplete event i need to send email after successful uploading but unfortunately I am getting following error. Because of this error I can't get uploaded video url etc
PATCH https://api.vimeo.com/videos/190425955 403 (Forbidden)

TUS is required

Recent changes in Vimeo's API caused the script to stop working. TUS is required.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.