WebRADDocumentationExplore WebRAD ↗
WEBRAD / TECHNICAL REFERENCE

Video Upload

Upload videos to RestGO with progress and resume support.

WebVideoUploadNonvisualNonvisual8 events

Quick start

Add VideoUpload1 in the Designer. Use the example in a page method.

VideoUpload1 · event
const selection = await VideoUpload1.OpenFile();
if (!selection) return;
VideoUpload1.title = 'Presentation';
VideoUpload1.descri = 'Product video';
VideoUpload1.isPublic = false;
try {
  const video = await VideoUpload1.SendToRestGO();
  Message(video.id);
  await VideoUpload1.WaitUntilReady({ timeoutMs: 600_000 });
} catch (error) {
  Message(error instanceof Error ? error.message : String(error));
}
// Pause(), Resume(), CancelUpload(), and Clear() control the upload.
  • Configure accept, maxFileSizeMB, and maxDurationSeconds; null disables optional limits.
  • OpenFile() selects; SendToRestGO() uploads in chunks. percentage tracks uploading and processingProgress tracks conversion.
  • Pause() preserves the checkpoint. Resume() uses the same file; after reloading, select it again and pass the saved resumeToken.
  • CancelUpload() cancels the remote session. Clear() clears local state.
  • OnProgress, OnStateChange, OnUploadComplete, OnProcessingProgress, OnReady, OnError, and OnComplete track the stages.

Inspector properties

Component options and defaults. Fields without runtime access are configured in the Inspector.

Property / sourceType and optionsDefaultRuntime access
nameName · Identitystring—name
acceptAccepted video types · BehaviorChooser filter. RestGo accepts MP4, MOV, MKV and WebM.string".mp4,.mov,.mkv,.webm"accept
enabledEnabled · Behaviorbooleantrueenabled
titleTitle · VideoEmpty uses the filename as the title on RestGo.string""title
descriDescription · Videostring""descri
isPublicPublic video · VideoPublic upload requires server permission. Private by default.booleanfalseisPublic
chunkSizeBytesChunk size (bytes) · UploadPositive integer. Automatically capped at the session maxChunkBytes.number8388608chunkSizeBytes
maxFileSizeMBMaximum file size (MB) · LimitsOptional local limit, 1 MB = 1024² bytes. Leave empty for no local limit; server limits still apply.numbernullmaxFileSizeMB
maxDurationSecondsMaximum duration (seconds) · LimitsOptional positive limit. The browser must be able to read the duration; leave empty to disable.numbernullmaxDurationSeconds

API in code

MemberSignatureAccess
titletitle: string;Read and write
descridescri: string;Read and write
isPublicisPublic: boolean;Read and write
acceptget accept(): string;Read and write
enabledget enabled(): boolean;Read and write
maxFileSizeMBget maxFileSizeMB(): number | null;Read and write
maxDurationSecondsget maxDurationSeconds(): number | null;Read and write
chunkSizeBytesget chunkSizeBytes(): number;Read and write
selectedFileget selectedFile(): File | null;Read-only
selectionget selection(): WebVideoUploadSelection | null;Read-only
uploadSessionget uploadSession(): import("@webrad/restgo-sdk").RestGoVideoUploadSession | null;Read-only
resumeTokenget resumeToken(): import("@webrad/restgo-sdk").RestGoVideoResumeToken | null;Read-only
videoget video(): import("@webrad/restgo-sdk").RestGoVideo | null;Read-only
stateget state(): WebVideoUploadState;Read-only
confirmedBytesget confirmedBytes(): number;Read-only
totalBytesget totalBytes(): number;Read-only
percentageget percentage(): number | null;Read-only
processingProgressget processingProgress(): number | null;Read-only
errorget error(): Error | null;Read-only
onChangeset onChange(handler: WebComponentEventHandler<this> | null);Read and write
onProgressset onProgress(handler: WebComponentEventHandler<this> | null);Read and write
onStateChangeset onStateChange(handler: WebComponentEventHandler<this> | null);Read and write
onUploadCompleteset onUploadComplete(handler: WebComponentEventHandler<this> | null);Read and write
onProcessingProgressset onProcessingProgress(handler: WebComponentEventHandler<this> | null);Read and write
onReadyset onReady(handler: WebComponentEventHandler<this> | null);Read and write
onErrorset onError(handler: WebComponentEventHandler<this> | null);Read and write
onCompleteset onComplete(handler: WebComponentEventHandler<this> | null);Read and write

OpenFile

method
OpenFile(): Promise<WebVideoUploadSelection | null>;

Opens the chooser from a user gesture. It never creates or sends an upload.

Example
VideoUpload1.OpenFile
await VideoUpload1.OpenFile();

SendToRestGO

method
SendToRestGO(options?: WebVideoUploadOptions): Promise<import("@webrad/restgo-sdk").RestGoVideo>;
Example
VideoUpload1.SendToRestGO
await VideoUpload1.SendToRestGO({ isPublic: false });

Resume

method
Resume(options?: WebVideoUploadResumeOptions): Promise<import("@webrad/restgo-sdk").RestGoVideo>;
Example
VideoUpload1.Resume
await VideoUpload1.Resume();

Pause

method
Pause(): void;

Aborts only local upload I/O. The server session remains resumable.

Example
VideoUpload1.Pause
VideoUpload1.Pause();

CancelUpload

method
CancelUpload(): Promise<void>;

Explicitly cancels the open upload on RestGo. It does not cancel conversion jobs.

Example
VideoUpload1.CancelUpload
await VideoUpload1.CancelUpload();

WaitUntilReady

method
WaitUntilReady(options?: import("@webrad/restgo-sdk").RestGoVideoWaitOptions): Promise<import("@webrad/restgo-sdk").RestGoVideo>;
Example
VideoUpload1.WaitUntilReady
await VideoUpload1.WaitUntilReady({ timeoutMs: 600_000 });

Clear

method
Clear(): void;

Clears local state and stops requests. No remote video/session is deleted.

Example
VideoUpload1.Clear
VideoUpload1.Clear();

dispose

method
dispose(): void;
Example
VideoUpload1.dispose
// Call only when disposing of an instance whose lifecycle you control.
VideoUpload1.dispose();
Inherited members (4)
MemberSignatureAccess
idreadonly id: string;Read-only
namereadonly name: string;Read-only

bindEvent

method
bindEvent(eventName: string, handler: WebComponentEventHandler<this> | null): () => void;

emit

method
emit(eventName: string, detail?: unknown): boolean;

Events

Link methods in Interaction. How to use events.

OnChange

WebVideoUploadChangeEventDetail in event.detail

Signature and example
Interaction → OnChange
import type { WebVideoUpload, WebVideoUploadChangeEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1Change(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadChangeEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
  }
}

OnProgress

WebVideoUploadProgressEventDetail in event.detail · confirmedBytes, totalBytes, percentage, chunk

Signature and example
Interaction → OnProgress
import type { WebVideoUpload, WebVideoUploadProgressEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1Progress(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadProgressEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { confirmedBytes, totalBytes, percentage, chunk } = event.detail;
    console.log(confirmedBytes, totalBytes, percentage, chunk);
  }
}

OnStateChange

WebVideoUploadStateEventDetail in event.detail · previous, state

Signature and example
Interaction → OnStateChange
import type { WebVideoUpload, WebVideoUploadStateEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1StateChange(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadStateEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { previous, state } = event.detail;
    console.log(previous, state);
  }
}

OnUploadComplete

WebVideoUploadResult in event.detail

Signature and example
Interaction → OnUploadComplete
import type { WebVideoUpload, WebVideoUploadResult } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1UploadComplete(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadResult>,
  ): Promise<void> {
    console.log(event.detail);
  }
}

OnProcessingProgress

WebVideoUploadProcessingEventDetail in event.detail · video, jobs

Signature and example
Interaction → OnProcessingProgress
import type { WebVideoUpload, WebVideoUploadProcessingEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1ProcessingProgress(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadProcessingEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { video, jobs } = event.detail;
    console.log(video, jobs);
  }
}

OnReady

WebVideoUploadResult in event.detail

Signature and example
Interaction → OnReady
import type { WebVideoUpload, WebVideoUploadResult } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1Ready(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadResult>,
  ): Promise<void> {
    console.log(event.detail);
  }
}

OnError

Error in event.detail

Signature and example
Interaction → OnError
import type { WebVideoUpload } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1Error(
    sender: WebVideoUpload,
    event: CustomEvent<Error>,
  ): Promise<void> {
    Message(event.detail.message);
  }
}

OnComplete

WebVideoUploadCompleteEventDetail in event.detail · operation, video, error

Signature and example
Interaction → OnComplete
import type { WebVideoUpload, WebVideoUploadCompleteEventDetail } from '@webrad/runtime';
// Copy this method into the page class and link it in Interaction.
class Example {
  public async VideoUpload1Complete(
    sender: WebVideoUpload,
    event: CustomEvent<WebVideoUploadCompleteEventDetail>,
  ): Promise<void> {
    console.log(event.detail);
    const { operation, video, error } = event.detail;
    console.log(operation, video, error);
  }
}
WebRAD · Atentor · Read in Markdown
Source code: 6a562bda75a0 (with local changes) · November 7, 2026

Search documentation

Type to search APIs, components, and events.