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

    Class BoxApplet<Msg, Params>

    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

    Hierarchy (View Summary)

    Index

    Properties

    customParams: Params | undefined

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

    getBoxToken: (() => Promise<string>) | null = null

    Requires Feature: box-token

    Returns the box authentication token

    The current box token

    getBoxUpdateDisplayBehaviour: (() => Promise<"hide" | "stay">) | null = null

    Requires Feature: box-headless

    Query the current update display behaviour for this applet.

    The current behaviour

    getBoxVisibility: (() => Promise<boolean>) | null = null

    Requires Feature: headless

    Query the box applet's current visibility.

    Whether the box applet content is currently visible

    getDisplayState:
        | (
            () => 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;
                    },
                >,
            >
        )
        | null = null

    Requires Feature: display-state

    Query what the box is currently displaying in detail.

    The display state of the box

    getDisplayStatus:
        | (() => Promise<"signage" | "applet" | "sharing" | "splash">)
        | null = null

    Requires Feature: display-status

    Query what the box is currently displaying.

    The display status of the box

    getVideoAnnouncementActive: (() => Promise<boolean>) | null = null

    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: (() => Promise<boolean>) | null = null

    Requires Feature: get-vivi-interactive

    Query whether Vivi Interactive is enabled for this room.

    Whether Vivi Interactive is enabled

    isBox: true = ...

    true for BoxApplet

    isClient: false = ...

    false for BoxApplet

    sendBoxEvent: ((name: string, data: {}) => Promise<boolean>) | null = null

    Requires Feature: box-events

    Send an event associated with the box

    promise that resolves once event is sent

    setBoxUpdateDisplayBehaviour:
        | ((behaviour: "hide" | "stay") => Promise<boolean>)
        | null = null

    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: ((visible: boolean) => Promise<boolean>) | null = null

    Requires Feature: headless

    Set the box applet's visibility.

    Whether the box applet content is visible

    setCaptions: ((captions: string[]) => Promise<boolean>) | null = null

    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: ((textScale: number) => Promise<boolean>) | null = null

    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: (() => Promise<boolean>) | null = null

    Requires Feature: stop-box-applet

    Request the system to stop this applet.

    true if the stop request was accepted

    stopPlayContent: (() => Promise<boolean>) | null = null

    Requires Feature: box-play-content-control

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

    true if the stop request was accepted

    stopScreenShare: (() => Promise<boolean>) | null = null

    Requires Feature: box-screen-share-control

    Request the box to stop the active screen share

    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>