v1.0 and v2.0 rooms are not interoperable; but the Token used by the SDK does not need to be updated.
v2.0 removed some APIs, you need to use the new API implementation through the following documents.
We will not close the v1.0 service, but we still recommend that you migrate to v2.0.
First, in order to enhance the page management function of the whiteboard, we introduce some new concepts: scenes and scene catalogs.
If you cannot understand the concept of scenes, we suggest you refer to the concept of resource management and files for reference.
The scene currently mainly includes: scene name, PPT (background image), PPT width, and PPT height.
There is another content that is related to the scene and not held by the scene itself: the scene path. The scene path consists of scene directory + scene name, the latter is held by the scene itself.
The scene directory is the directory where the file is located. (For the scene directory in the SDK, the format refers to the file format under Unix system. \dir1\dir
)
Recommended reading Page (scene) management
The 2.0 API modification is mainly in the scene. In order to support more complex page management requirements, we abandoned the past, and the whiteboard is in the form of a string of page arrays. Instead, use the resource manager for management.
We still provide access to ppt API, but we no longer recommend using this API. Because even if you get the ppt address, you cannot manage the page through the index index where the ppt address is located. Therefore, we recommend the following methods to get the content of the current page:
//Return to the current scene directory, all scenes, the ppt attribute may be empty.
[whiteRoom getScenesWithResult:^(NSArray<WhiteScene *> * _Nonnull scenes) {
for (WhiteScene *s in scenes) {
NSLog(@"ppt:%@", s.ppt.src);
}
}];
//In the obtained WhiteSceneState, there is the current scene directory, all the scene lists in the scene directory, and the index of the current scene in the scene list.
[whiteRoom getSceneStateWithResult:^(WhiteSceneState * _Nonnull state) {
NSLog(@"sceneState:%@", state);
}];
Currently, you need to manage the scene catalog yourself. If you do not have multiple scene lists (multi-dimensional arrays) requirements. I suggest you use a fixed scene directory (for example \
).
Old method:
-(void)pushPptPages:(NSArray<WhitePptPage *>*)pptPages;
new method:
/**
Insert, maybe create multiple pages
@param dir scence The name of the page group, equivalent to a directory.
@param scenes WhiteScence instance; when generating WhiteScence, ppt can be configured at the same time
@param index Select the position to insert in the page group. index is the index position of the new scence. If you want to put it at the end, you can pass in NSUIntegerMax.
*/
-(void)putScenes:(NSString *)dir scenes:(NSArray<WhiteScene *> *)scenes index:(NSUInteger)index;
Old method:
-(void)removePage:(NSInteger)page;
new method:
/**
When there is
/ppt/page0
/ppt/page1
When "/ppt/page0" is passed in, only the corresponding page will be deleted.
When "/ppt" is passed in, the two pages will be removed together.
@param dirOrPath page specific path, or page group path
*/
-(void)removeScenes:(NSString *)dirOrPath;
Now delete, no longer accept the index index, correspondingly, accept the path of the scene, or the directory.
/**
Insert, maybe create multiple pages
@param dir scence The name of the page group, equivalent to a directory.
@param scenes WhiteScence instance; when generating WhiteScence, ppt can be configured at the same time
@param index Select the position to insert in the page group. index is the index position of the new scence. If you want to put it at the end, you can pass in NSUIntegerMax.
*/
-(void)putScenes:(NSString *)dir scenes:(NSArray<WhiteScene *> *)scenes index:(NSUInteger)index;
Now insert page API, add the interface of custom content (ppt) when inserting. So the insert page API and insert PPT API have now been merged into the same API.
We now provide new API to support mobile, rename whiteboard page
Since the picture replacement API is effective for interactive rooms and playback at the same time, we no longer put it in WhiteRoomCallbackDelegate
, but instead put it in WhiteCommonCallbackDelgate
.
If you need to enable it, please set the enableInterrupterAPI
property of WhiteSdkConfiguration
to YES when initializing the SDK.
And during initialization, use the following method to pass in an instance that implements the protocol
-(instancetype)initWithWhiteBoardView:(WhiteBoardView *)boardView config:(WhiteSdkConfiguration *)config commonCallbackDelegate:(nullable id<WhiteCommonCallbackDelegate>)callback
Or when you want to use it, call the setCommonCallbackDelegate:
method of whiteSDK
to set.