1.0.2 • Published 7 months ago

vimeo-video-uploader v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
7 months ago

Vimeo Video Uploader

This package allows you to seamlessly upload videos to Vimeo from either a public link or directly from a video file within your own application. To use this package, you'll need to configure a Vimeo application client in your Vimeo account and obtain an Access Token, which will enable your application to access Vimeo's features and upload videos.

Installation

You can install the package using npm in your Node.js project:

npm install vimeo-video-uploader

Get Started

Once the module is installed in your project, import it to use its features:

const vimeo = require('vimeo-video-uploader');

// Initialize the Vimeo client with your credentials
const vimeoClient = new vimeo(clientID, clientSecret, accessToken);

Upload from video file (Buffer)

To upload a video file from your server, you'll need to read the file and pass its content to the method as shown below:

const vimeo = require('vimeo-video-uploader');

// Initialize the Vimeo client with your credentials
const vimeoClient = new vimeo(clientID, clientSecret, accessToken);

// Specify the upload parameters
const params = {
    video: file.buffer,
    name: 'Video Name',
    description: 'Video Description',
    folder: 'Vimeo Folder ID' // Optional: Specify a folder to upload the file to
};

// Returns a promise
vimeoClient.uploadFromBinary(params).then(res => {
    console.log(res);
}).catch(err => {
    console.log(err);
});

Upload from video link (public)

To upload a video file via an internet link, make sure the video is publicly accessible. You can use the following code:

const VimeoUploader = require('vimeo-video-uploader');

const vimeoClient = new VimeoUploader(clientID, clientSecret, accessToken);

// Call the uploader
const params = {
    link: 'http://link.com/video.mp4',
    name: 'Video Name',
    description: 'Video Description',
    folder: 'vimeo_folder_ID' // Optional: Upload to a specific folder
};

// Returns a promise
vimeoClient.uploadFromLink(params)
    .then(res => {
        console.log(res);
    })
    .catch(err => {
        console.error(err);
    });

Feel free to customize this further or let me know if there's anything specific you'd like to add or modify!

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

8 months ago