Agora Interactive Whiteboard Java API Reference
Public Member Functions | Static Public Member Functions | List of all members
com.herewhite.sdk.WhiteSdk Class Reference

Public Member Functions

void setCommonCallbacks (CommonCallback commonCallback)
 
AudioMixerImplement getAudioMixerImplement ()
 
 WhiteSdk (JsBridgeInterface bridge, Context context, WhiteSdkConfiguration whiteSdkConfiguration)
 
 WhiteSdk (JsBridgeInterface bridge, Context context, WhiteSdkConfiguration whiteSdkConfiguration, @Nullable CommonCallback commonCallback)
 
 WhiteSdk (JsBridgeInterface bridge, Context context, WhiteSdkConfiguration whiteSdkConfiguration, UrlInterrupter urlInterrupter)
 
 WhiteSdk (JsBridgeInterface bridge, Context context, WhiteSdkConfiguration whiteSdkConfiguration, @Nullable CommonCallback commonCallback, @Nullable AudioMixerBridge audioMixerBridge)
 
void joinRoom (final RoomParams roomParams, final Promise< Room > roomPromise)
 
void joinRoom (final RoomParams roomParams, final RoomListener roomListener, final Promise< Room > roomPromise)
 
void setupFontFaces (FontFace[] fontFaces)
 
void loadFontFaces (FontFace[] fontFaces, final Promise< JSONObject > loadPromise)
 
void updateTextFont (String[] names)
 
void releaseRoom ()
 
void releaseRoom (String uuid)
 
void requestSlideLog (File logFile, final Promise< Boolean > promise)
 
void updateSlideVolume (float volume)
 
void getSlideVolume (Promise< Double > promise)
 
void setSlideListener (SlideListener slideListener)
 

Static Public Member Functions

static String Version ()
 
static void prepareWhiteConnection (Context context, ConnectionPrepareParam param)
 

Detailed Description

The WhiteSdk class.

Constructor & Destructor Documentation

◆ WhiteSdk() [1/4]

com.herewhite.sdk.WhiteSdk.WhiteSdk ( JsBridgeInterface  bridge,
Context  context,
WhiteSdkConfiguration  whiteSdkConfiguration 
)

Initializes the WhiteSdk instance.

Ensure that you call WhiteSdk to create and initialize a WhiteSdk instance before calling any other APIs.

Parameters
bridgeThe whiteboard view. See WhiteboardView.
contextThe context of the Android Activity.
whiteSdkConfigurationConfigurations for the WhiteSdk instance. See WhiteSdkConfiguration.

◆ WhiteSdk() [2/4]

com.herewhite.sdk.WhiteSdk.WhiteSdk ( JsBridgeInterface  bridge,
Context  context,
WhiteSdkConfiguration  whiteSdkConfiguration,
@Nullable CommonCallback  commonCallback 
)

Initializes the WhiteSdk instance.

Ensure that you call WhiteSdk to create and initialize a WhiteSdk instance before calling any other APIs.

Parameters
bridgeThe whiteboard view. See WhiteboardView.
contextThe context of the Android Activity.
whiteSdkConfigurationConfigurations for the WhiteSdk instance. See WhiteSdkConfiguration.
commonCallbackCommon callback events. See CommonCallback.

◆ WhiteSdk() [3/4]

com.herewhite.sdk.WhiteSdk.WhiteSdk ( JsBridgeInterface  bridge,
Context  context,
WhiteSdkConfiguration  whiteSdkConfiguration,
UrlInterrupter  urlInterrupter 
)

Initializes the WhiteSdk instance.

Ensure that you call WhiteSdk to create and initialize a WhiteSdk instance before calling any other APIs.

Parameters
bridgeThe whiteboard view, see WhiteboardView.
contextThe context of the Android Activity.
whiteSdkConfigurationConfigurations for the WhiteSdk instance. See WhiteSdkConfiguration.
urlInterrupterSets the interception of image URL addresses. See UrlInterrupter.
Deprecated:
The urlInterrupter parameter in this method is deprecated. Use the urlInterrupter method of the CommonCallbacks interface instead.

◆ WhiteSdk() [4/4]

com.herewhite.sdk.WhiteSdk.WhiteSdk ( JsBridgeInterface  bridge,
Context  context,
WhiteSdkConfiguration  whiteSdkConfiguration,
@Nullable CommonCallback  commonCallback,
@Nullable AudioMixerBridge  audioMixerBridge 
)

Initializes the WhiteSdk instance.

Ensure that you call WhiteSdk to create and initialize a WhiteSdk instance before calling any other APIs.

Parameters
bridgeThe whiteboard view, see WhiteboardView.
contextThe context of the Android Activity.
whiteSdkConfigurationConfigurations for the WhiteSdk instance. See WhiteSdkConfiguration.
commonCallbackCommon callback events. See CommonCallback.
audioMixerBridgeSets audio mixing. See AudioMixerBridge. When you use the Agora RTC SDK and Interactive Whiteboard SDK at the same time, and the dynamic PPT displayed in the whiteboard contains audio files, you can call the AudioMixerBridge interface to play the audio in the dynamic PPT using the Agora RTC SDK interface.

Member Function Documentation

◆ setCommonCallbacks()

void com.herewhite.sdk.WhiteSdk.setCommonCallbacks ( CommonCallback  commonCallback)

Sets common event callbacks.

The SDK uses the CommonCallback class to report SDK runtime events to the application.

Parameters
commonCallbackCommon event callbacks. See CommonCallback.

◆ getAudioMixerImplement()

AudioMixerImplement com.herewhite.sdk.WhiteSdk.getAudioMixerImplement ( )

Gets the AudioMixerImplement instance.

Returns
The AudioMixerImplement instance.

◆ Version()

static String com.herewhite.sdk.WhiteSdk.Version ( )
static

Gets the SDK version number.

Returns
The version of the current SDK in the string format. For example, "2.12.11".

◆ joinRoom() [1/2]

void com.herewhite.sdk.WhiteSdk.joinRoom ( final RoomParams  roomParams,
final Promise< Room roomPromise 
)

Joins the live Interactive Whiteboard room.

Parameters
roomParamsConfigurations for the Room instance. See RoomParams.
roomPromisePromise<Room> interface instance. See Promise. You can get the call result of joinRoom through this interface:
  • The Room instance, if the method call succeeds. See Room.
  • An error message, if the method call fails.

◆ joinRoom() [2/2]

void com.herewhite.sdk.WhiteSdk.joinRoom ( final RoomParams  roomParams,
final RoomListener  roomListener,
final Promise< Room roomPromise 
)

Joins the live Interactive Whiteboard room.

Parameters
roomParamsConfigurations for the Room instance. See RoomParams.
roomListenerSets room event callbacks. See RoomListener. When the SDK reconnects to the Interactive Whiteboard server, if you do not pass in the roomListener parameter, the SDK uses the previously set roomListener parameter. To release the roomListener, call releaseRoom.
roomPromisePromise<Room> interface instance. See Promise. You can get the call result of joinRoom through this interface:
  • The Room instance, if the method call succeeds. See Room.
  • An error message, if the method call fails.

◆ setupFontFaces()

void com.herewhite.sdk.WhiteSdk.setupFontFaces ( FontFace[]  fontFaces)

Declares the fonts that can be used in the local whiteboard.

Since
2.11.2

The fonts declared by this method can be used to render the characters in PPT and the characters entered by the text tool.

Both this method and loadFontFaces can declare the fonts to be used in the local whiteboard. The difference is that setupFontFaces has no callback to report whether the font declaration is successful; loadFontFaces triggers callbacks to report the preload result of each type of font.

Note
  • This method works only for the local whiteboard and does not affect the font display of the remote whiteboard.
  • Fonts declared by this method will be downloaded only when they are used.
  • Font rendering may vary by device. For example, on some devices, the text will not be rendered until the font has finished loading, while on others, the text will be rendered first using the default font and then refreshed as a whole when the specified font has finished loading.
  • Each time this method is called, it overrides the original font declaration.
  • Do not call this method and the loadFontFaces method at the same time; otherwise, unexpected results may occur.
Parameters
fontFacesThe specified fonts. See FontFace.

◆ loadFontFaces()

void com.herewhite.sdk.WhiteSdk.loadFontFaces ( FontFace[]  fontFaces,
final Promise< JSONObject >  loadPromise 
)

Declares the fonts that can be used in the local whiteboard and preloads them.

Since
2.11.2

The fonts declared by this method can be used to render the characters in PPT and the characters entered by the text tool.

Both this method and setupFontFaces can declare the fonts to be used in the local whiteboard. The difference is that setupFontFaces has no callback to report whether the font declaration is successful; loadFontFaces triggers callbacks to report the preload result of each type of fonts.

Note
  • This method works only for the local whiteboard and does not affect the font display of the remote whiteboard.
  • Fonts declared by this method will be downloaded only when they are used.
  • Font rendering may vary by device. For example, on some devices, the text will not be rendered until the font has finished loading, while on others, the text will be rendered first using the default font and then refreshed as a whole when the specified font has finished loading.
  • Fonts declared and preloaded by this method cannot be deleted. Each method call adds the new fonts to the already preloaded fonts.
  • Do not call this method and the setupFontFaces method at the same time; otherwise, unexpected results may occur.
Parameters
fontFacesThe specified fonts. See FontFace.
loadPromiseThe Promise interface instance. See Promise. You can get the call result of loadFontFaces through this interface:
  • The FontFace object, if the method call succeeds.
  • An error message, if the method call fails.

◆ updateTextFont()

void com.herewhite.sdk.WhiteSdk.updateTextFont ( String[]  names)

Sets the fonts used by the text tool in the local whiteboard.

Since
2.11.2
Note
  • This method only works for the local whiteboard and does not affect the font display of the remote whiteboard.
  • This method cannot set the fonts for rendering the characters in PPT.
Parameters
namesNames of the fonts. If the specified font does not exist in the user's system, the text tool cannot use the font. Ensure you call setupFontFaces or loadFontFaces to preload the specified font into the local whiteboard.

◆ releaseRoom() [1/2]

void com.herewhite.sdk.WhiteSdk.releaseRoom ( )

Releases the Room instance and removes the RoomListener callback.

Since
2.4.12

◆ releaseRoom() [2/2]

void com.herewhite.sdk.WhiteSdk.releaseRoom ( String  uuid)

Releases the Room instance and removes the RoomListener callback.

Deprecated:
This method is deprecated. Use releaseRoom instead.
Parameters
uuidRoom UUID, the unique identifier of a room. You do not need to specify this parameter because a WhiteSdk instance supports joining only one live Interactive Whiteboard room.

◆ requestSlideLog()

void com.herewhite.sdk.WhiteSdk.requestSlideLog ( File  logFile,
final Promise< Boolean >  promise 
)

Requests the slide log.

Parameters
logFileThe file that stores the slide log.
promiseThe callback of the request.

◆ updateSlideVolume()

void com.herewhite.sdk.WhiteSdk.updateSlideVolume ( float  volume)

Updates the volume of the PPT slide.

Parameters
volumeVolume. The value range is (0,1].

◆ getSlideVolume()

void com.herewhite.sdk.WhiteSdk.getSlideVolume ( Promise< Double >  promise)

Gets the volume of the PPT slide.

Parameters
promiseThe result of the method call, including two fields, volume and error:
  • A successful call: volume ranges from (0,1], indicating the volume of the PPT; error returns nil.
  • A failed call: volume returns 0; error returns the error message.

◆ setSlideListener()

void com.herewhite.sdk.WhiteSdk.setSlideListener ( SlideListener  slideListener)

Sets the listener for PPT slides. PPT slides use the SlideListener class to report events to App.

Parameters
slideListenerCommon callback events. See SlideListener.

◆ prepareWhiteConnection()

static void com.herewhite.sdk.WhiteSdk.prepareWhiteConnection ( Context  context,
ConnectionPrepareParam  param 
)
static

Preselects the optimal access domain to improve the connection speed for when the user connects for the first time.

Agora recommends you call this method before joining a whiteboard room, for example, on the device detection page or the whiteboard room list page, thus improving the connection speed when joining a whiteboard room.

Parameters
contextThe context of the Android Activity.
paramThe whiteboard connection preparation parameters, see ConnectionPrepareParam.