remixz / to-streamable

Upload video quickly to Streamable.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

to-streamable

Upload video quickly to Streamable.

Build Status

js-standard-style

Installation

NPM

npm install -g to-streamable

Usage

Usage: to-streamable [options] [path to video file]
If no video path is passed, then stdin is used.

Options:

  --help, -h     Prints this help message.

  --version, -v  Prints current version.

  --setup        Launches a wizard to save Streamable username and password.

  --auth         Sets the username and password used for uploading.
                 Must be in a colon pair. `to-streamable --auth=user:pass`
                 If passed, this is preferred over any saved authentication.

  --no-resize    Tells Streamable to not resize final video.

  --mute         Tells Streamable to mute final video.

API

let vid = require('to-streamable')(<opts>)

Returns a new to-streamable instance. opts is an object. Valid parameters:

  • file - A Readable stream of the video. (i.e. fs.createReadStream('/path/to/video')) This is passed to request's formData option. Required.
  • auth - An object containing a username and password property of your Streamable credentials. Required.
  • params - An array of parameters to add to the request. Valid options are noresize and mute. See the Streamable API Docs for more info.

Example:

let opts = {
  file: fs.createReadStream('/path/to/file'),
  auth: {
    username: 'foo',
    password: 'bar'
  },
  params: ['mute']
}

vid.upload([cb(err, res)])

Starts the upload of the video. cb is an optional callback function. Called with parameters err, containing an Error, if any, and res, with the object response from the Streamable API. See the Streamable API Docs for format.

vid.status([cb(err, res)])

Retrieves the status of the video upload. vid.upload() must be called beforehand. cb is an optional callback function. Called with parameters err, containing an Error, if any, and res, with the object response from the Streamable API. See the Streamable API Docs for format.

About

Upload video quickly to Streamable.com

License:MIT License


Languages

Language:JavaScript 100.0%