Skip to main content

LensStudio:Preview.PausedByUser

Class

Pause reason reported when the creator pauses the Preview panel or switches it to a paused or inspected stream.

Index

Example

Describe a creator-initiated pause in a status message. Pass a preview's pauseReason.

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

export function describeUserPause(reason: LensPreview['pauseReason']): string | null {
if (!(reason instanceof PausedByUser)) return null;
const stream = reason.streamType ? ` (${reason.streamType})` : '';
return `${reason.message}${stream}. Resume the preview, then try again.`;
}

Constructors

Constructor

new PausedByUser(): PausedByUser

Constructs a PausedByUser value with its default message and an empty stream type.

Returns

PausedByUser

Properties

isResumable

readonly isResumable: boolean

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


isSuspending

readonly isSuspending: boolean

Whether this reason suspends the preview input.


message

readonly message: string

User-facing pause message, "Paused by Creator".


streamType

readonly streamType: string

Stream type the creator switched the preview to, or an empty string if none was given.