Overview
Updated
Learn the structure, identification, content, and management rules of whiteboard scenes.
When you enter a whiteboard room, you see a page that extends infinitely in all directions. Interactive Whiteboard calls this page a scene. On a scene, you can write and draw, insert an image, and present a dynamic PPT slide. In a whiteboard room, you can add multiple scenes, switch between scenes, and move a scene. These capabilities enable you to implement advanced functions such as displaying a complete PPT file on the whiteboard.
This feature is for Web only.
This page introduces the scene structure, scene identification, the contents that can be displayed on a scene, and the rules for adding, deleting, and modifying a scene. Once you grasp these basic concepts, you can build an interactive whiteboard application with multiple scenes according to your business needs.
Scene structure
An Interactive Whiteboard room can have scene directories and scenes, which are organized in a tree structure. A newly created Interactive Whiteboard room contains a root scene directory and an initial scene by default. By using the APIs provided by the Whiteboard SDK, you can insert multiple scene directories or scenes in the room. Under a scene directory there can be subdirectories or scenes.
The whiteboard room supports displaying a specific scene, but not a scene directory. The room can display one scene at a time.
The following schematic diagram shows an example scene structure of an Interactive Whiteboard room:
Interactive Whiteboard scene structure example
Scene identification
In an Interactive Whiteboard room, each scene or scene directory has a unique path in string format as its identifier. The path of a scene or scene directory is the path of its direct parent node plus the name of the scene or scene directory. The scene or scene directory path must begin with / and use / to separate the scene hierarchy.
Note the following:
- The path of the root scene directory is
/and the path of the initial scene is/init. - Scenes and subdirectories under the same scene directory cannot have duplicate names.
- Because
/is used to separate scene directories, do not include any/symbols in scene names.
For example, if you insert a scene directory named Math that contains scenes ClassA and ClassB in the root directory, then the paths of the new scene directory and scenes are as follows:
/Math/Math/ClassA/Math/ClassB
The order of scenes in a scene directory is identified by the index number, which starts from 0. By specifying the index number, you can switch to a specific scene or insert a new scene at a specific location.
Scene content
On a whiteboard scene, in addition to writing and drawing by using the whiteboard tools, you can also display images or web pages in the following formats:
- Static images in PNG, JPG/JPEG, and WEBP formats.
- Static images in PNG, JPG/JPEG, and WEBP formats converted from PPT, PPTX, DOC, DOCX, and PDF files. You can convert them yourself or use the static-file conversion service of Interactive Whiteboard.
- HTML web pages converted from PPTX files. You must use the dynamic-file conversion service of Interactive Whiteboard to do the conversion.
Scene management
By calling APIs of the Whiteboard SDK, you can add, delete, and move scenes. The rules for managing a scene are as follows:
Adding scenes
When you add a new scene, the SDK performs one of the following operations, depending on the path of the new scene:
- If the scene path contains scene directories that do not exist, the SDK automatically creates the scene directories and adds the new scene.
- If the scene directories contained in the scene path already exist and the name of the new scene is unique in the direct parent scene directory, the SDK adds the new scene.
- If the scene path is duplicated with an existing scene, then the SDK fails to add the new scene. Note that the SDK does not trigger an error message for this failure.
Deleting scenes
The root directory in a whiteboard room cannot be deleted and each room must have at least one scene. When all scenes and subdirectories in a scene directory are deleted, the scene directory is deleted along with them; when all scenes in a whiteboard room are deleted, the SDK automatically creates an initial scene with the path /init.
Moving scenes
Scenes are ordered, but scene directories are not. You can call the API to move a specified scene, but you cannot change the position of a scene directory through the API.
Scenes example
The following example demonstrates the rules for adding and deleting scenes:
Assuming the current whiteboard room is new, it has only the root scene directory / and the scene /init.
When you add a new scene with the path /math/class-A, the SDK automatically creates a scene directory with the path /math.
Subsequently, when you add a new scene with path /math/class-B, the SDK directly adds the new scene to the /math scene directory.
When you delete the /math/class-A scene, the SDK removes the scene class-A from the /math scene directory.
After that, when you delete the /math/class-B scene, the SDK automatically deletes the /math scene directory because all the scenes in that directory are deleted.
