Skip to content
Last updated

cpUploadUI

Provides a user-friendly interface for uploading video files via a drag-and-drop widget or upload button—no coding needed for the user.

upload-ui

Include the Script

Add this <script> tag to your HTML page to load the uploader UI:

<script type="text/javascript" data-lazy-type="iframe" data-src="//wwwcdn.cincopa.com/_cms/ugc/uploaderui.js"></script> 

Initialize the UI

var uploaderUI = new cpUploadUI(element, options);uploaderUI.start(); 

Parameters

  • element: In this argument, a DOM element needs to be, where the component will be created.
  • options: This contains an object of options for initial setup. URL is a required option as it will be the server URL, where the API will try to upload.:
    • upload_url: The destination to send the uploaded video.
    • width: The width of the component in pixels (by default - 780)
    • height: The height of the component in pixels (default - 400).
    • theme_color: The theme color of component (by default – #0086CF)
    • multiple : allow multiple uploads (by default – true)
    • regex: Regular expression for allowed file extensions
    • btnText: “Choose files to upload”
    • onUploadComplete: function which will be called when the file has been successfully uploaded

Callable Methods

The following are the allowed callable methods that you can use to execute certain predefined functions:

  • start() - Renders the uploader widget inside the selected element.

Here you can view cpUploadUI and cpRecordUI in action