Skip to main content

LensStudio:Preview.Suspended

Class

Pause reason reported while a preview is suspended, for example after LensPreview.pause().

Index

Example

Pause and resume a headless preview, and report whether it is suspended.

import { LensPreview } from 'LensStudio:LensPreview';
import { Suspended } from 'LensStudio:Preview';

export function isSuspended(preview: LensPreview): boolean {
return preview.pauseReason instanceof Suspended;
}

export function togglePause(preview: LensPreview): boolean {
if (isSuspended(preview)) {
preview.resume();
} else {
preview.pause();
}
return isSuspended(preview);
}

Constructors

Constructor

new Suspended(): Suspended

Constructs a Suspended value with an empty message.

Returns

Suspended

Properties

isResumable

readonly isResumable: boolean

Whether the preview can be resumed from this state. Always true for Suspended.


isSuspending

readonly isSuspending: boolean

Whether this reason suspends the preview input. Always true for Suspended.


message

readonly message: string

Explanation of why the preview is suspended, or an empty string if none was given.