Hierarchy

  • Control

Constructors

Properties

serverConfig: {
    eventId: any;
    spaceId: any;
} = ...

Type declaration

  • eventId: any
  • spaceId: any

Methods

  • Contorl function by event. (chat)

    Example

    If you wanna open chat function by event.

    app.control.changeEventStatus("chat", true)
    

    If you wanna close chat function by evnet.

    app.control.changeEventStatus("chat", false)
    

    Throws

    Error message

    Parameters

    • type: string

      control content, option: ['chat']

    • status: boolean

      switch status, option: [true, false]

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Pop up a message to remind the user.

    Example

    If you want to disable all features

    app.control.changeSpaceSetting(false, false, false)
    

    Throws

    Error message

    Parameters

    • canHandUp: boolean

      whether to allow all users to raise their hands

    • canAutoMove: boolean

      whether to allow all users to use automatic wayfinding

    • canFollow: boolean

      whether to allow all users to follow others

    • canInvitationFace: boolean

      whether to allow all users to invitation face others

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Contorl function by space. (microphone, camera, sharescreen)

    Example

    If you wanna open microphone function by event.

    app.control.changeSpaceStatus("microphone", true)
    

    If you wanna close camera function by evnet.

    app.control.changeSpaceStatus("camera", false)
    

    Throws

    Error message

    Parameters

    • type: string

      control content, option: ['microphone', 'camera', 'sharescreen']

    • status: boolean

      switch status, option: [true, false]

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Pop up a message to remind the user.

    Example

    If you wanna pop up a message to all users

    app.control.gameToast("success", "Hello world!", 3000, [])
    

    Throws

    Error message

    Parameters

    • type: string

      type of message, option: ["success", "warning", "error", "info"]

    • content: string

      content of message

    • duration: number

      duration of message, milliseconds

    • pidArr: string[]

      pid list of users receiving notifications, [] means all users

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Control background music.

    Example

    If you wanna play a music as bgm by event.

    app.control.handleBgm("event", 1, {name: "test", url: "https://xxxx.mp3", 0.6})
    

    If you wanna pause bgm by space.

    app.control.handleBgm("event", 2, {name: "test", url: "https://xxxx.mp3", 0.6})
    

    Throws

    Error message

    Parameters

    • scope: string

      control scope, option: ['space', 'event']

    • status: number

      background music status, option: [0, 1, 2], 0:reset, 1:start, 2:suspended

    • bgm: {
          name: string;
          url: string;
          volume: number;
      }

      background music infomation, contains: {name, url, volume}

      • name: string
      • url: string
      • volume: number

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Pop up a widget for customize api game.

    Throws

    Error message

    Parameters

    • pidArr: any

      pid list of users receiving notifications, [] means all users

    • type: string

      type of widget, please contact Vland staff to customize type

    • url: string

      content of widget, please contact Vland staff to customize content

    • param: string

      customize params for widget

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Open a iframe popup.

    Example

    If you wanna open a iframe popup in developer mode.

    app.control.openIframe("https://xxxxxx.com", "rgba(0,0,0,0.7)", "fullscreen", true)
    

    Throws

    Error message

    Parameters

    • content: string

      content of sticky notes

    • background: string

      background color of popup

    • style: string

      the position of popup, option: ["fullscreen", "center"]

    • developerMode: boolean

      the iframe in developer mode can be passed to you after the link vlandId and vlandName

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Open a sticky note popup.

    Example

    If you wanna open sticky note popup with black background.

    app.control.openNote("this is a note", "rgba(0,0,0,1)")
    

    Throws

    Error message

    Parameters

    • content: string

      content of sticky notes

    • background: string

      background color of popup

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

  • Open a interactive object popup. (file, video, picture, live) Only live streaming in m3u8 format is supported.

    Example

    If you wanna open file popup with transparent background in full screen.

    app.control.openPopup("file", "https://xxxx.pdf", "rgba(0,0,0,0)", "fullscreen")
    

    If you wanna open live popup in the middle of the screen.

    app.control.openPopup("live", "https://xxxx.m3u8", "rgba(0,0,0,0.7)", "center")
    

    Throws

    Error message

    Parameters

    • type: string

      type of interactive object, option: ['file', 'video', 'picture', 'live']

    • content: string

      link of interactive object

    • background: string

      background color of popup

    • style: string

      the position of popup, option: ["fullscreen", "center"]

    Returns Promise<boolean>

    If it is successfully sent to the server, it will return true. Otherwise it will return an error message

Generated using TypeDoc