The current timestamp (ms) that is calibrated using the server time.
Callbacks. Refer to the following example to set a callback:
The number of remaining redoable actions (the number of times redo can be called).
The number of remaining undoable actions (the number of times undo can be called).
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 user from operating the whiteboard tools through the mouse, keyboard, or touchscreen:
true
: Disable the user from operating the whiteboard tools.false
: Enable the user to operate the whiteboard tools.This method is different from isWritable
. See Prohibited operation.
Whether to disable the eraser from erasing images on the whiteboard:
true
: Disable the eraser from erasing images.false
: Enable the eraser to erase images.Whether to disable the highlighted box when another user puts their cursor on an object on the whiteboard:
Whether to disable the local serialization:
true
: Disable the local serialization.false
: Enable the local serialization.The following methods cannot take effect after the setting of disableSerialization(true)
:
redo
undo
duplicate
copy
paste
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.
Whether the user is in interactive mode in the room:
true
: In interactive mode, where the user has read and write permissions on the whiteboard.false
: In subscription mode, where the user has read-only access to the whiteboard.The ID of the user.
In a live Interactive Whiteboard room, observerId
is the ID of the local user.
The connection state of the room. See RoomPhase.
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 Room Token for user authentication.
The user's screen type, which is used to adjust parameters for gesture recognition.
The unique identifier (UUID) of the current session in the room. If you
enable the SDK to report logs all the time, this parameter is reported in the logs.
If the SDK has not connected to the server when reporting logs, this parameter is shown as undefined
.
The unique identifier (UUID) of the current slice.
The business status of the room.
Sets the delay (ms) for displaying remote whiteboard contents on the local
client. The value of timeDelay
must be equal to or greater than 0. The
default value is 0.
After you set this parameter, when the local user receives the remote
whiteboard contents, the SDK delays displaying the contents based on the
value of timeDelay
.
In scenarios with significant audio and video transmission delays, for example, when using a CDN to distribute audio and video streams, you can use this parameter to delay displaying the received remote whiteboard contents, so as to ensure that the whiteboard contents and the audio and video streams are synchronized.
The unique identifier of a user in the room, which is in string format.
Whether to use the native clipboard:
true
: Use the native clipboard. The whiteboard shortcuts, such as copy and paste in {@link Hotkeys HotKeys}, will be disabled and replaced with the native copy
and paste
events.false
: (Default) Do not use the native clipboard.Room UUID, the unique identifier of a room.
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
.
Clears all contents on the current scene.
Whether to retain the PPT slide:
true
: (Default) Leave the PPT slide on the scene.false
: Clear the PPT slide together with all other contents.Clears the undo history, setting the number of undo steps canUndoSteps
to 0 immediately.
Whether to clear the redo history as well:
true
: (default) Clear the redo history as well.false
: Do not clear the redo history.Displays an image in the specified image placeholder.
The method inserts and displays an online image in the specified image placeholder.
Note
Ensure that you have called insertImage to insert an image placeholder on the whiteboard.
The unique identifier of the image, which is the image UUID that you pass in ImageInformation of the insertImage method.
The URL address of the image. Ensure the application client can access the URL; otherwise, the image cannot be displayed.
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.
Copies the selected content.
Note
false
.Creates an invisible plugin object.
The class of the invisible plugin.
The attributes of the invisible plugin.
The created invisible plugin object.
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.Deletes the selected content.
Disconnects from the live Interactive Whiteboard room.
This method allows the user to leave the room and releases all resources related to the room. The user that has left the room must call joinRoom again to join the room.
Sends a custom event.
Note
All users that listen for this event receive the notification.
The custom event.
The content of the custom event.
Copies and pastes the selected content into the center of the user view on the whiteboard.
Note
false
.Gets information about all scenes in the room.
Information about all scenes in the room.
Exports a scene.
The path of the scene to be exported.
The Blob object of the exported scene contents.
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 attributes of the component plugin object.
The unique identifier of the plugin in the room.
Gets the position of the component plugin object on the whiteboard.
The unique identifier of the plugin in the room.
The rectangle for the component plugin object.
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.
Imports a scene.
The scene directory to which the scene contents are imported. Ensure that ScenePathType of the scene directory is not
conflict
ï¼›otherwise, the scene cannot be imported. You can use scenePathType to get the path type of the scene directory.
The Blob object of the scene contents.
A SceneDefinition object, if the method call succeeds. The returned SceneDefinition object includes name
of the imported scene.
The path of the imported scene is dir
+ name
. You can call moveScene to change the scene path if needed.
Inserts an image placeholder on the whiteboard.
The method sets up and inserts an image placeholder on the whiteboard
per imageInfo
you pass in.
You also need to call completeImageUpload to pass in the URL address of the image to insert and display the image in the placeholder.
The image information. See ImageInformation.
Inserts a component plugin object to the whiteboard.
The type of the component plugin, which is the unique identifier of the plugin.
Description of the component plugin.
The unique identifier of the plugin in the room.
Inserts text at a specified position.
The X coordinate of the midpoint of the left edge of the first character in the world coordinate system.
The Y coordinate of the midpoint of the left edge of the first character in the world coordinate system.
The initial text. If you do not pass in a value, the content is empty.
The identifier of the text in string format.
Locks an image.
When an image is locked, users cannot move or zoom the image.
The unique identifier (UUID) of the image.
Whether to lock the image:
true
: Lock the image.false
: Do not lock the image.Locks selected images.
Whether to lock selected images:
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.
Moves a scene.
After a scene is moved, the path of the scene changes.
The original path of the scene to be moved. It cannot be the path of a scene directory.
The path of the target scene directory or the target path of the scene under the current directory:
Moves the selected components to the bottom layer.
Moves the selected components to the top layer.
Pastes the copied content.
Note
false
.Plays the next slide of the dynamic PPT file.
When the current PPT slide finishes playing, the SDK switches to the next scene to play the next PPT slide.
Returns to the previous slide of the dynamic PPT file.
When the current PPT slide is rolled back, the SDK switches back to the previous scene to play the previous PPT slide.
Inserts multiples scenes under the specified scene directory.
Note
This method does not switch the whiteboard scene to any of the newly inserted scenes. You need to call setScenePath to switch to one of the newly inserted scenes.
The path of the scene directory, which must starts with /
and cannot be the path of a scene. For example, "/math"
.
An array of scenes. For the files of a single scene, see SceneDefinition.
The index of the first scene to be inserted under the specified scene directory. The index of a scene under a scene directory starts from 0.
Redoes an undone action.
Note
This method takes effect only when you set disableSerialization as false
.
The number of remaining redoable actions.
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.
Deletes a component plugin object.
The unique identifier of the plugin in the room.
Deletes a scene or a scene directory.
Note
There must be at least one scene in the live Interactive Whiteboard room.
If you delete all scenes, the SDK automatically creates an initial scene with the path of /init
.
If you delete the current whiteboard scene, the whiteboard displays the last scene under the current scene directory.
If you delete a scene directory, all scenes under the directory will be deleted.
If you delete the current scene directory, for example, dirA
, the SDK
executes upward recursive logic to locate the new scene:
dirB
,the SDK switches the
whiteboard scene to the first scene under dirB
(with the index of 0).dirC
, before the deleted dirA
, then the SDK switches the whiteboard
scene to the first scene under dirC
(with the index of 0).The SDK continues executing upward recursive logic until a new scene is found.
The path of a scene or a scene directory. If you pass in the path of a scene directory, this method deletes all scenes under the directory.
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.
Modifies the globalState
of the live Interactive Whiteboard room.
The globalState
property of the live Interactive Whiteboard room is a public global variable.
All users in the room can read the globalState
property, while users in interactive mode can modify the globalState
property.
The modified globalState
will be updated to all users in the room immediately.
Refer to the following example to modify the globalState
property:
The globalState
property.
The modified globalState
.
Modifies the state of the whiteboard tool.
A successful call of this method updates the MemberState of the room immediately.
Refer to the following example to modify MemberState
:
The state of the whiteboard tool. See MemberState.
The modified state.
Switches to the specified scene under the current scene directory.
A successful call of this method switches the whiteboard scene to the specified scene.
Note
The specified scene must exist in the current scene directory; otherwise, the method call fails.
The index of the target scene in the current scene directory.
Switches to the specified scene.
A successful call of this method switches the whiteboard scene to the specified scene.
Note
This method call is synchronous.
The scene switch may fail due to the following reasons:
/
and consists of the scene directory and scene name.The path of the scene that you want to switch to. Ensure
the scene path stars with /
and consists of the scene directory and scene name. For example, /math/classA
.
Sets the view mode of the user.
In the live Interactive Whiteboard room, you can set one of the following view modes for a user:
Broadcaster
: Host mode.Follower
: Follower mode.Freedom
: (Default) Freedom mode.Note
The view mode setting of a user is affected by the view mode setting of other users in the room as follows:
Freedom
view mode by default.Broadcaster
, the view mode of every other user in the room (including users that join subsequently) is automatically set as 'Follower'.Follower
view mode operates the whiteboard, their view mode automatically switches to Freedom
mode.Sets whether a user is in interactive mode in the room.
Whether the user is in interactive mode:
true
: The user is in interactive mode (has read and write permissions on the whiteboard).false
: The user is in subscription mode (has read-only access to the whiteboard).Cancels the Unix timestamp (ms) for displaying remote whiteboard contents on the local client, which is set by syncBlockTimestamp.
Sets the Unix timestamp (ms) for displaying remote whiteboard contents on the local client.
The Unix timestamp (ms) for displaying remote whiteboard contents on the local client.
The number of remaining undoable actions.
Updates the description of the component plugin object.
The unique identifier of the plugin in the room.
The updated description.
Modifies the font style of the currently selected text.
After selecting some text, you can call this method to modify the font size, color, bold style, and italic style of the text.
The font style after modification. See TextFormat.
Modifies the specified text.
After calling insertText, you can call this method and pass in the identifier
returned by the insertText
method to modify the content of the specified text.
The identifier of the text, which is the return value of insertText
.
The new text.
Waits for a customized event.
The event filter.
The specified customized event when it occurs.
The
Room
interface extends theDisplayer
interface and adds properties for operating a live Interactive Whiteboard room.