1.0.14 • Published 7 years ago

react-kaltura-resumablejs v1.0.14

Weekly downloads
8
License
MIT
Repository
github
Last release
7 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

7 years ago

1.0.13

8 years ago

1.0.12

8 years ago

1.0.11

8 years ago

1.0.10

8 years ago

1.0.9

8 years ago

1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago