1.0.14 • Published 9 years ago

react-kaltura-resumablejs v1.0.14

Weekly downloads
8
License
MIT
Repository
github
Last release
9 years ago

React Kaltura Resumable JS

Uploader with ReactResumableJS to upload file into Kaltura

NPM

CircleCI CircleCI

Install

npm i react-kaltura-resumablejs

Node Version

  • LTS

Options

  • server: http path to upload the file. Ex: http://kaltura.com/api_v3
  • ks: Kaltura secret key from Kaltura.
  • uploaderID: Container ID to render the ReactResumableJS. Ex: "video-uploader",
  • filetypes: Set the video extensions to upload. Ex: 'mp4','avi'.
  • chunksize: Set in KB the size to upload the file in chunks. Ex: 1024.
  • simultaneousUploads: amount of upload at same time. Ex: 1.
  • onError: Catch the upload error. Must be a function. Ex: (error) => { return error; }.
  • onSuccess: Catch the file success when finish the upload. Ex: (success) => { return success}
  • textLabel: "Uploaded files",
  • fileAddedMessage: "Started",
  • completedMessage: "Complete!:"
  • disableInput Boolean to disable or enable input file. Send true to disable, false otherwise.
  • maxFileSize The allowed file size for upload. Is expressed in bytes. Default is: 104857600 (100mb).
  • maxFiles Indicates how many files can be uploaded in a single session. Valid values are any positive integer and undefined for no limit. (Default: undefined)
  • onMaxFileSizeErrorCallback Usefull to use with the above param, and take the exception for use as you want.
  • maxFilesErrorCallback A function which displays the please upload n file(s) at a time message. (Default: displays an alert box with the message Please n one file(s) at a time.)
  • fileAccept Set the file accept.

Changelogs

Changelogs

Example

export default class Example extends React.Component {

    constructor(props) {
        super(props);
    }
    
    render() {

        return (

            <div>
               <ReactKalturaResumableJs
                   server="http://www.kaltura.com/api_v3"
                   ks="0_asdfafdvsdbsdgsdgsdgs"
                   uploaderID="myKalturaUploader"
                   onFileSuccess={(success) => { console.log(success); }}
                   onFileRemoved={(file) => { console.log(file); }}
                   onError={(error) => { console.log(error); }}
                   maxFileSize={104857600}
                   categories="14,15,16"
                   maxFiles={3}
                   onMaxFileSizeErrorCallback={function (files) {
                       alert("max size: 104857600");
                   }}
                   maxFilesErrorCallback={function () {
                       alert("Max Files: 1");
                   }}
               />
            </div>

        );
    }
}

Demo

npm run demo

1.0.14

9 years ago

1.0.13

9 years ago

1.0.12

10 years ago

1.0.11

10 years ago

1.0.10

10 years ago

1.0.9

10 years ago

1.0.8

10 years ago

1.0.7

10 years ago

1.0.6

10 years ago

1.0.5

10 years ago

1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago