Related API:
public void insertImage(ImageInformation imageInfo);
public void completeImageUpload(String uuid, String url);
ImageInformation
class, configure the image, width and height, and the position of the center point, set the uuid, and ensure that the uuid is unique.insertImage:
method and pass in an instance of ImageInformation
. The whiteboard first generates a placeholder at this time.completeImageUpload
method, the uuid parameter is the uuid passed by the insertImage:
method, and src is the actual image network address.Difference | Insert PPT | Insert Picture |
---|---|---|
After calling the result | multiple whiteboard pages will be created automatically, but they are still on the current page (so there is no obvious difference), need to switch through the page turning API | to generate a placeholder interface, insert a real picture, you need to call completeImageUploadWithUuid:src: , The uuid passed into the placeholder interface, and the network address of the picture |
Move | Cannot move, so no location information is needed | Can move, so when inserting, you need to provide picture size and location information |
Relationship with the whiteboard page | When inserting the ppt, a new page is created on the whiteboard. The background of this page is the PPT picture | It is part of the current whiteboard page, and multiple pictures can be added to the same page |
In some cases, we need to sign a certain picture to ensure that the picture is only used internally.
The replacement API can intercept the picture before actually inserting it into the whiteboard, and modify the address of the last picture actually inserted. **This method is valid for both ppt pictures and normal inserted pictures. **
During playback, the image address is still the unreplaced address, and it needs to be signed through this API.
WhiteSdkConfiguration sdkConfig = new WhiteSdkConfiguration(DeviceType.touch, 10, 0.1);
//Must be replaced when sdk is initialized
sdkConfig.setHasUrlInterrupterAPI(true);
//Initially a class that implements the UrlInterrupter interface can be used as the initialization parameter of WhiteSDK.
UrlInterrupterObject interrupter = new UrlInterrupterObject()
WhiteSdk whiteSdk = new WhiteSdk(whiteBroadView PlayActivity.this, interrupter);
This method will work for ppt insertion and picture insertion API at the same time.
This API will be called frequently during rendering. If there is no demand, there is no need to use this method.
Starting from 2.2.0, the API is split into:
Prohibit user movement, zoom API:disableCameraTransform
(For details, please refer to Viewing Angle Operation-Viewing Angle Change);
Disable user input API:disableDeviceInputs
(For details, please refer to Teaching Aid Use-Disable Teaching Aid Operation API.
You can pass room.disableOperations(true)
to prohibit users from operating the whiteboard.
You can use room.disableOperations(false)
to restore the user's ability to operate the whiteboard.
2.6.0 and higher version support
On the one hand, you can zoom in and out of the whiteboard through gestures (two-finger gestures on iOS and Android, two-finger gestures on mac os, and the scroll wheel of the middle mouse button on windows). On the other hand, you can also zoom the whiteboard through zoomChange
.
room.zoomChange(10);
The background color of the whiteboard itself is transparent. If you need to set the background color, you only need to set the backgroundColor to the WhiteboardView.
New API in 2.0.0 official version
Starting from 2.0.0, the SDK supports developers to carry some additional information when joining a room.
The field will be converted to a value in JSON, so it needs to meet the constraints of JSON on JSON elements.
In other clients, you can query the room roomMembers
to obtain the information carried by each user.
New features in version 2.0.0-beta7. 2.0.0 official version with enhanced functions.
userCursor
in the WhiteSdkConfiguration
to true
.RoomParams
userPayload
field when you join a room, and make sure that the avatar
field exists.WhiteSdkConfiguration sdkConfiguration = new WhiteSdkConfiguration(DeviceType.touch, 10, 0.1, true);
sdkConfiguration.setUserCursor(true);
HashMap<String, String> payload = new HashMap<>();
payload.put("avatar", "https://example.com/user.png");
RoomParams roomParams = new RoomParams("uuid", "roomToken", payload);
2.0.0-beta7 version, you can configure the
MemberInformation
field.
1.x does not provide this API, 2.0.0-beta8
adds API.
//Room.java
//Set the delay in seconds
public void setTimeDelay(Integer timeDelay)
//Get the local client, the number of seconds for automatic delay
public Integer getTimeDelay()
Quickly set the whiteboard delay, artificially add a part of the delay to the whiteboard, and delay the playback to meet the needs of synchronization with audio and video in the case of HLS.
be careful:
/**
Clear the current screen content
@param retainPPT Whether to retain ppt
*/
public void cleanScene(boolean retainPpt)
2.4.2 New API
Starting from 2.4.2, the sdk will collect debug logs in the sdk, mainly related to the output of API calls.
When using WhiteSdkConfiguration
to initialize the SDK, configure the LoggerOptions
option in WhiteSdkConfiguration
, call the setDisableReportLog
method of LoggerOptions
, set it to true, and then initialize WhiteSDK to close the uploaded content.