@viviedu/applet-sdk
    Preparing search index...

    Class BoxApplet<Msg, Params, ReqFeats>

    An instance of BoxApplet, methods and attributes affect and refer to an applet running on the Vivi Receiver.

    Do not directly instantiate, instead use newApplet or newBoxApplet.

    Type Parameters

    • Msg
    • Params extends BaseParams = never
    • ReqFeats extends BoxAppletFeature = never

    Hierarchy (View Summary)

    Index

    Properties

    customParams: Params | undefined

    The params that were passed (custom_params) when starting the applet.

    edgeAi: FeatureGate<ReqFeats, readonly ["box-edge-ai"], EdgeAi>

    Requires Feature: box-edge-ai

    Namespace to access the Edge-AI functionality.

    getBoxToken: FeatureGate<
        ReqFeats,
        readonly ["box-token"],
        () => Promise<string>,
    >

    Requires Feature: box-token

    Returns the box authentication token

    The current box token

    getBoxUpdateDisplayBehaviour: FeatureGate<
        ReqFeats,
        readonly ["box-headless"],
        () => Promise<"hide" | "stay">,
    >

    Requires Feature: box-headless

    Query the current update display behaviour for this applet.

    The current behaviour

    getBoxVisibility: FeatureGate<
        ReqFeats,
        readonly ["box-headless"],
        () => Promise<boolean>,
    >

    Requires Feature: headless

    Query the box applet's current visibility.

    Whether the box applet content is currently visible

    getDisplayState: FeatureGate<
        ReqFeats,
        readonly ["box-display-status"],
        () => Promise<
            UndefinedToOptional<
                {
                    displays: UndefinedToOptional<
                        {
                            device_id: string;
                            device_name: string
                            | undefined;
                            display_id: string;
                            frozen: boolean;
                            hibernating: boolean;
                            hidden: boolean;
                            is_local: boolean;
                            is_presenter: boolean;
                            kind: "play-content" | "stream" | undefined;
                            ready: boolean;
                            screens: number[];
                            source: "play-content" | "screen" | "camera";
                        },
                    >[];
                    is_presenter: boolean;
                    local_device_id: string;
                },
            >,
        >,
    >

    Requires Feature: display-state

    Query what the box is currently displaying in detail.

    The display state of the box

    getDisplayStatus: FeatureGate<
        ReqFeats,
        readonly ["box-display-status"],
        () => Promise<"signage" | "applet" | "sharing" | "splash">,
    >

    Requires Feature: display-status

    Query what the box is currently displaying.

    The display status of the box

    getRoomCodeVisibility: FeatureGate<
        ReqFeats,
        readonly ["box-room-code-visibility"],
        () => Promise<boolean>,
    >

    Requires Feature: box-room-code-visibility

    Query whether the room code is currently shown on the box display.

    Whether the room code is currently visible on the display

    getVideoAnnouncementActive: FeatureGate<
        ReqFeats,
        readonly ["box-get-video-announcement-active"],
        () => Promise<boolean>,
    >

    Requires Feature: box-get-video-announcement-active

    Query whether a video announcement is currently playing on the box.

    Whether a video announcement is currently active

    getViviInteractiveEnabled: FeatureGate<
        ReqFeats,
        readonly ["box-get-vivi-interactive"],
        () => Promise<boolean>,
    >

    Requires Feature: get-vivi-interactive

    Query whether Vivi Interactive is enabled for this room.

    Whether Vivi Interactive is enabled

    hideTimer: FeatureGate<
        ReqFeats,
        readonly ["box-timer-controls"],
        () => Promise<boolean>,
    >

    Requires Feature: box-timer-controls

    Hide the timer overlay on the display without stopping the countdown. Box-authored, like stopTimer.

    true if the hide request was accepted

    isBox: true = ...

    true for BoxApplet

    isClient: false = ...

    false for BoxApplet

    sendBoxEvent: FeatureGate<
        ReqFeats,
        readonly ["box-events"],
        (name: string, data: {}) => Promise<boolean>,
    >

    Requires Feature: box-events

    Send an event associated with the box

    promise that resolves once event is sent

    setBoxUpdateDisplayBehaviour: FeatureGate<
        ReqFeats,
        readonly ["box-headless"],
        (behaviour: "hide" | "stay") => Promise<boolean>,
    >

    Requires Feature: box-headless

    Set what the box should do when an the box triggers update_display (stream start, stream pause, play content seek, etc.). 'hide' will hide the applet (default), 'stay' will keep it visible.

    The behaviour to use

    if the behaviour was set

    setBoxVisibility: FeatureGate<
        ReqFeats,
        readonly ["box-headless"],
        (visible: boolean, deviceId?: string) => Promise<boolean>,
    >

    Requires Feature: headless

    Set the box applet's visibility.

    Whether the box applet content is visible

    Device id of the client making the applet visible.

    setCaptions: FeatureGate<
        ReqFeats,
        readonly ["box-captions"],
        (captions: string[]) => Promise<boolean>,
    >

    Requires Feature: box-captions

    Sets the captions on the box, which appear over all other content. Can also be used to clear the captions by passing an empty array.

    An array of strings, each being one line of captions.

    if the captions were set

    setCaptionsTextScale: FeatureGate<
        ReqFeats,
        readonly ["box-captions-text-scaling"],
        (textScale: number) => Promise<boolean>,
    >

    Requires Feature: box-captions-text-scaling

    Sets the text size of the captions on the box.

    The scale to set to, should be a number between 0.0 and 1.0 (inclusive). 0.0 is the (default) minimum size, 1.0 is maximum.

    if the caption text scale were set

    stop: FeatureGate<
        ReqFeats,
        readonly ["box-stop-applet"],
        () => Promise<boolean>,
    >

    Requires Feature: stop-box-applet

    Request the system to stop this applet.

    true if the stop request was accepted

    stopPlayContent: FeatureGate<
        ReqFeats,
        readonly ["box-play-content-control"],
        () => Promise<boolean>,
    >

    Requires Feature: box-play-content-control

    Request the box to stop the active play-content display.

    true if the stop request was accepted

    stopScreenShare: FeatureGate<
        ReqFeats,
        readonly ["box-screen-share-control"],
        () => Promise<boolean>,
    >

    Requires Feature: box-screen-share-control

    Request the box to stop the active screen share

    true if the stop request was accepted

    stopTimer: FeatureGate<
        ReqFeats,
        readonly ["box-timer-controls"],
        () => Promise<boolean>,
    >

    Requires Feature: box-timer-controls

    Stop and clear the share screen timer on the display. Box-authored: the box is the timer's source of truth, so this succeeds regardless of which client session started the timer (use when the share the timer belonged to has ended, e.g. an ownership takeover).

    true if the stop request was accepted

    Accessors

    • get _debug(): { features: string[]; mode: "control" | "signage" }

      Properties exposed specifically for debugging purposes only

      Caution

      The contents, structure and existence of _debug are not stable, backwards-compatible or guaranteed. Do not use for business logic.

      Returns { features: string[]; mode: "control" | "signage" }

    Methods

    • Add a listener for any incoming messages sent from other applet instances.

      The message will be of type Msg that the user defines. (eg: Applet<Msg>)

      Parameters

      • listener: Listener<Msg>

        The listener function that will be called when a message is received.

      Returns () => void

      A callback to remove the listener

    • Send an message of type Msg to other applet instances.

      Will reject if the message was not successfully sent.

      Parameters

      • message: Msg

        The message to be sent

      Returns Promise<void>