Callbacks. Refer to the following example to set a callback:
The user's device type, which determines how the SDK handles mouse and touch events.
Whether to disable the user from adjusting (moving or zooming) the view through touchscreen gestures or mousewheel movement:
true
: Disable the user from adjusting the view.false
: (Default) Enable the user to adjust the view.Note
This method does not affect the setCameraBound
, moveCamera
, or moveCameraToContain
methods.
Whether to disable the highlighted box when another user puts their cursor on an object on the whiteboard:
Whether the user currently has write permission:
Whether to enable the hand tool:
true
: Enable the hand tool.false
: Disable the hand tool.The hotkeys for the hand tool. The user can use the hand tool to move the page.
If you set this property to undefined
, the hand tool has no hotkeys.
The ID of the user.
In a live Interactive Whiteboard room, observerId
is the ID of the local user.
The data center, which supports the following values:
region |
Data center | Service area |
---|---|---|
us-sv |
Silicon Valley, United States | North America and South America |
sg |
Singapore | Singapore, East Asia, and Southeast Asia |
in-mum |
Mumbai, India | India |
eu |
Frankfurt, Europe | Europe |
cn-hz |
Hangzhou, China | Areas not covered by other data centers |
The user's screen type, which is used to adjust parameters for gesture recognition.
The unique identifier (UUID) of the current slice.
The state of the Displayer
object.
The version of the current SDK.
Adds a listener for a customized event.
You can receive the customized event callback after a successful call of this method.
Note
The SDK triggers only one callback for the customized events with the same name.
The name of the customized event to be listened for.
The customized event callback. See EventListener. If you add multiple callbacks for the same event, the callback added later overrides the one added earlier.
Since v2.15.2. Options for setting a custom event listener. See MagixEventListenerOptions.
Adds a high-frequency listener for a customized event.
You can receive the customized event callback after a successful call of this method.
Note
The SDK triggers only one callback for the customized events with the sane name.
The name of the customized event to be listened for.
The customized events callback. See EventsListener. If you add multiple callbacks for the same event, the callback added later overrides the one added earlier.
The interval (ms) at which the SDK triggers the callback. The minimum interval is 500 ms. The SDK automatically adjusts the value smaller than 500 to 500.
Binds the whiteboard to an HTML container.
The HTML container for the whiteboard. You can unbind the
whiteboard by setting this parameter to null
.
Converts the coordinates of a point on the whiteboard.
This method converts the coordinates of the screen coordinate system (taking the upper left corner as the origin) to the coordinates of the world coordinate system (taking the center of the initial whiteboard as the origin).
The coordinates of the point in the screen coordinate system.
The X coordinate of the point in the screen coordinate system.
The Y coordinate of the point in the screen coordinate system.
The coordinates of the point in the world coordinate system.
The X coordinate of the point in the world coordinate system.
The Y coordinate of the point in the world coordinate system.
Creates a listener object for a scene directory.
After the listener object is successfully created, when the scenes and subdirectories in the specified scene directory change, the SDK triggers the callbacks you have registered in ScenesCallbacks to report the scene events. When you no longer need the created listener, call dispose to release the listener object.
The path of the scene directory. If you pass in a scene path, the SDK sets the listened object to its parent scene directory.
The callbacks to be listened to. See ScenesCallbacks
.
null
if the method call fails. The method call can fail because the specified scene directory does not exist.Gets information about all scenes in the room.
Information about all scenes in the room.
Generates the snapshot of the specified scene.
The path of the specified scene.
The div for the snapshot.
The width of the snapshot. This parameter is optional since v2.3.8. If you do not set this parameter, it is set to the width of the div for the snapshot.
The height of the snapshot. This parameter is optional since v2.3.8. If you do not set this parameter, it is set to the height of the div for the snapshot.
Generates the screenshot of the specified scene.
The path of the scene. You can get the current scenePath
via room.state.sceneState.scenePath
.
The width of the screenshot.
The height of the screenshot.
The URL address of the screenshot.
Note
If the scene displays an image or dynamic PPT slide, ensure that the storage server of the image or the PPT slide supports cross-origin resource sharing; otherwise, the image or PPT slide may not be shown in the generated screenshot.
Gets the specified invisible plugin.
The type of the invisible plugin.
The specified invisible plugin.
Gets the information about a specified scene.
The path of a scene. Ensure the scene path stars with /
and consists of the scene directory and scene name.
For example, /math/classA
.
The information about the specified scene. See WhiteScene.
Gets the state of the whiteboard tool used by the user.
The ID of the user.
The state of the whiteboard tool used by the user.
Adjusts the view.
The view configuration. See Camera.
Adjusts the view to ensure the complete display of the view rectangle.
Configuration of the view rectangle. See Rectangle.
Refreshes the whiteboard view.
When the whiteboardView changes, you need to call this method to refresh the whiteboard view.
This method takes effect only when autoResize
is set to false
.
Removes a listener for a customized event.
The name of the event.
The listener you want to remove. If you do not set this parameter, all listeners for the event are removed.
Adjusts the view in the specified mode to ensure the complete display of the PPT slide.
The animation mode for adjusting the view. See AnimationMode.
Gets the type of the scene path.
The path of the scene.
The type of the scene path.
Generates the preview of the specified scene.
The path of the specified scene.
The div for the preview.
The width of the preview. This parameter is optional since v2.3.8. If you do not set this parameter, it is set to the width of the div for the preview.
The height of the preview. This parameter is optional since v2.3.8. If you do not set this parameter, it is set to the height of the div for the preview.
Generates the snapshot and writes it into the specified CanvasRenderingContext2D object.
The CanvasRenderingContext2D object.
The path of the scene. You can get the current scenePath
via room.state.sceneState.scenePath
.
The width of the snapshot.
The height of the snapshot.
The description of the view angle. See Camera.
The device pixel ratio. This parameter is optional. If you do not set this parameter, the default value is 1.
Generates a screen snapshot and writes it into the specified CanvasRenderingContext2D
object after the images in the target scene have finished loading.
The CanvasRenderingContext2D object.
The path of the scene. You can get the current scenePath
via room.state.sceneState.scenePath
.
The width of the snapshot.
The height of the snapshot.
The description of the view angle. See Camera.
The device pixel ratio. This parameter is optional. If you do not set this parameter, the default value is 1.
The timeout time (ms) for image loading. The default is never to time out and can only be set to a number greater than 0
. If the image loading time exceeds this value, the SDK proceeds to the next drawing operation without waiting for the image to complete loading.
Sets the boundary of the local user's view.
The boundary of the view.
Waits for a customized event.
The event filter.
The specified customized event when it occurs.
The
Displayer
interface is the basic interface for interactive whiteboard rooms.