Options
All
  • Public
  • Public/Protected
  • All
Menu

This component creates a uploader panel to upload videos. See UploaderParams for accepted parameters

const uploader = new Uploader(parentContainer, {})

uploader.subscribe('uploadCompleted', function (_, { upload }) {
  console.log('user completed uploading ', upload.video)
})

Hierarchy

  • UIComponent<UploaderEventMap>
    • Uploader

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

  • Parameters

    Returns Uploader

Properties

metadata

metadata: undefined | Metadata

Video metadata

subscribe

subscribe: <FullEventMap, Event>(event: Event, callback: EventHandler<Event, FullEventMap[Event]>) => () => void = ...

Subscribe on component event

param

Event name

param

Callback function

Type declaration

    • <FullEventMap, Event>(event: Event, callback: EventHandler<Event, FullEventMap[Event]>): () => void
    • Subscribe on event

      Type parameters

      • FullEventMap: UploaderEventMap & { *: any }

      • Event: string

      Parameters

      • event: Event

        This string can contain: event name, namespace of event name, list of event names separated by a space or '*' to subscribe on all events

      • callback: EventHandler<Event, FullEventMap[Event]>

        Callback function

      Returns () => void

      • Function that cancels current subscription
        • (): void
        • Returns void

tags

tags: undefined | string[]

Video tags

title

title: undefined | string

Title of the video

unsubscribe

unsubscribe: <FullEventMap, Event>(event: Event, callback?: EventHandler<Event, FullEventMap[Event]>) => void = ...

Unsubscribe from component event

param

Event name

param

Callback function

Type declaration

    • <FullEventMap, Event>(event: Event, callback?: EventHandler<Event, FullEventMap[Event]>): void
    • Unsubscribe from event

      Type parameters

      • FullEventMap: UploaderEventMap & { *: any }

      • Event: string

      Parameters

      • event: Event

        This string can contain: event name, namespace of event name, list of event names separated by a space or '*' to unsubscribe from all events

      • Optional callback: EventHandler<Event, FullEventMap[Event]>

        Callback function

      Returns void

Accessors

element

  • get element(): HTMLElement
  • Root HTML element

    Returns HTMLElement

upload

  • Current upload

    Returns null | Upload

Methods

destroy

  • destroy(): void
  • Destroy component instance and remove it from the DOM

    Returns void

resetUpload

  • resetUpload(force?: boolean): void
  • Resets uploader to initial state if there is no active upload

    Parameters

    • force: boolean = false

      whether we should cancel any active uploads and force reset

    Returns void

Legend

  • Constructor
  • Property
  • Method
  • Accessor
  • Property
  • Method
  • Inherited property

Generated using TypeDoc