larksr_websdk 3.3.102 → 3.3.105

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/dist/doc/en/config.md +99 -99
  2. package/dist/doc/en/dev.md +21 -21
  3. package/dist/doc/en/event_codes.md +117 -117
  4. package/dist/doc/en/events.md +72 -72
  5. package/dist/doc/en/functions.md +239 -239
  6. package/dist/doc/en/index.md +1 -1
  7. package/dist/doc/en/member_variables.md +116 -120
  8. package/dist/doc/en/multi_media_3_2_401.md +20 -20
  9. package/dist/doc/en/sdkid_encryption.md +14 -14
  10. package/dist/doc/en/update.md +462 -462
  11. package/dist/doc/zh_CN/config.md +1 -1
  12. package/dist/doc/zh_CN/event_codes.md +1 -1
  13. package/dist/doc/zh_CN/functions.md +2 -2
  14. package/dist/doc/zh_CN/index.md +1 -1
  15. package/dist/doc/zh_CN/multi_media_3_2_401.md +1 -1
  16. package/dist/doc/zh_CN/update.md +579 -579
  17. package/dist/larksr-web-sdk.min.js +1 -1
  18. package/dist/types/api.d.ts +4 -0
  19. package/dist/types/appli_params.d.ts +21 -0
  20. package/dist/types/lark/application.d.ts +2 -1
  21. package/dist/types/lark/message.d.ts +1 -0
  22. package/dist/types/larksr.d.ts +87 -4
  23. package/dist/types/localization/ui.d.ts +2 -0
  24. package/dist/types/operation/keyboard_handler.d.ts +25 -0
  25. package/dist/types/utils/lock_pointer.d.ts +2 -1
  26. package/package.json +72 -72
  27. package/types/api.d.ts +4 -0
  28. package/types/appli_params.d.ts +21 -0
  29. package/types/lark/application.d.ts +2 -1
  30. package/types/lark/message.d.ts +1 -0
  31. package/types/larksr.d.ts +87 -4
  32. package/types/localization/ui.d.ts +2 -0
  33. package/types/operation/keyboard_handler.d.ts +25 -0
  34. package/types/utils/lock_pointer.d.ts +2 -1
  35. package/dist/types/lark/custom.d.ts +0 -7
  36. package/dist/types/lark/webcodecs.generated.d.ts +0 -417
  37. package/dist/types/protobuf/cloudlark.d.ts +0 -9674
  38. package/dist/types/utils/ios-inner-height.d.ts +0 -4
  39. package/types/lark/custom.d.ts +0 -7
  40. package/types/lark/webcodecs.generated.d.ts +0 -417
  41. package/types/protobuf/cloudlark.d.ts +0 -9674
  42. package/types/utils/ios-inner-height.d.ts +0 -4
@@ -22,7 +22,7 @@ SDK include:
22
22
  ### Notice
23
23
 
24
24
  > SDK V3.2.30 only support server version above [V3.2.3.1](https://www.pingxingyun.com/devCenter.html)
25
- > [Old verion SDK Demo](https://github.com/pingxingyun/lark_sr_websdk_demos/releases/tag/V3.2.10)
25
+ > [Old verion SDK Demo](https://github.com/ParaverseTechnology/lark_sr_websdk_demos/releases/tag/V3.2.10)
26
26
  > V3.2.314 server and datachannel above 3.2.5.1
27
27
 
28
28
  ## Quick Start
@@ -1,72 +1,72 @@
1
- # LarkSR 对象成员变量
1
+ # LarkSR Object Member Variables
2
2
 
3
- LarkSR 对象成员变量,注意以下划线开头的变量为内部使用私有变量或只读成员变量,不建议修改直接使用。
3
+ LarkSR object member variables. Note that variables starting with an underscore are internal private variables or read-only member variables and are not recommended for direct modification or use.
4
4
 
5
- > 以下代码中 larksr 为创建好的 LarkSR 对象实例。省略创建过程。
5
+ > In the following code, `larksr` is an instance of the created LarkSR object. The creation process is omitted.
6
6
 
7
7
  ```javascript
8
8
  let larksr;
9
9
 
10
- ...// create code.
10
+ // ... create code.
11
11
  ```
12
12
 
13
- ## 视频组件
13
+ ## Video Component
14
14
 
15
- 1. `videoComponent` 视频组件
15
+ 1. `videoComponent` Video Component
16
16
 
17
17
  ```javascript
18
- // 获取播放的 <video /> 视频元素
18
+ // Get the <video /> video element being played
19
19
  larksr.videoComponent.getVideo();
20
- // 播放视频,async 方法播放失败抛出异常
20
+ // Play the video, async method throws an exception if playback fails
21
21
  larksr.videoComponent.playVideo();
22
- // 停止视频播放
22
+ // Stop video playback
23
23
  larksr.videoComponent.stopVideo();
24
- // 播放视频声音,取消静音播放
24
+ // Play video sound, unmute playback
25
25
  larksr.videoComponent.sountPlayout();
26
- // 截取一帧,返回 base64,并抛出截图成功事件
26
+ // Capture a frame, return base64, and throw a screenshot success event
27
27
  larksr.videoComponent.captrueFrame(data);
28
28
  ```
29
29
 
30
- 2. `videoElement` html `video` 视频元素本身
30
+ 2. videoElement HTML video video element itself
31
31
 
32
32
  ```javascript
33
33
  larksr.videoElement;
34
34
  ```
35
35
 
36
- 3. 控制显示元素
36
+ 3. Control Display Elements
37
37
 
38
38
  ```javascript
39
- // 是否显示移动端触摸点
39
+ // Whether to show touch points on mobile
40
40
  larksr.isEnableTouchPoint = false;
41
- // 是否显示载入画面时底部文字
41
+ // Whether to show bottom text during loading screen
42
42
  larksr.isEnableLoadingStateBar = false;
43
43
  ```
44
44
 
45
45
  ```javascript
46
- // 设置缩放模式
46
+ // Set zoom mode
47
47
  larksr.scaleMode = ScaleMode.CONTAIN_APP;
48
48
  ```
49
49
 
50
- 4. 虚拟鼠标和触摸点
50
+ 4. Virtual Mouse and Touch Points
51
51
 
52
52
  ```javascript
53
53
  /**
54
- * 虚拟鼠标的当前位置,相对于整体容器
54
+ * Current position of the virtual mouse, relative to the overall container
55
55
  */
56
56
  larksr.virtualCursorPosition
57
57
  /**
58
- * 虚拟鼠标的当前位置,内部缩放容器,与实际显示虚拟鼠标 CSS 样式相同
58
+ * Current position of the virtual mouse, internal zoom container, same as the actual display virtual mouse CSS style
59
59
  */
60
60
  larksr.virtualCursorPositionRaw
61
61
  ```
62
62
 
63
- 例:
63
+ Example:
64
64
 
65
- 下面示例代码使用 react 演示点击一个按钮,同步一个外层的元素和虚拟鼠标的位置
65
+ The following example code uses React to demonstrate clicking a button to synchronize the position of an outer element and the virtual mouse.
66
66
 
67
67
  ```javascript
68
68
  // ....
69
- // 省略 react 创建代码
69
+ // Omitted React creation code
70
70
  export default class App extends React.Component {
71
71
  private state: any = {
72
72
  pointPosition: {
@@ -75,12 +75,12 @@ export default class App extends React.Component {
75
75
  }
76
76
  };
77
77
  // ....
78
- // 此处省略 larksr 创建过程等其他代码
78
+ // Omitted larksr creation process and other code
79
79
  render() {
80
80
  return (
81
81
  <div>
82
82
  // ...
83
- // 省略其他元素
83
+ // Omitted other elements
84
84
  <div style={{
85
85
  zIndex: 1000,
86
86
  position: 'absolute',
@@ -94,9 +94,9 @@ export default class App extends React.Component {
94
94
  </div>
95
95
  <button style={{pointerEvents: "all"}}
96
96
  onClick={()=>{
97
- // 获取虚拟鼠标的位置
97
+ // Get the position of the virtual mouse
98
98
  console.log("touch point", this.larksr.virtualCursorPosition);
99
- // 同步虚拟鼠标的位置
99
+ // Synchronize the position of the virtual mouse
100
100
  this.setState({
101
101
  pointPosition: this.larksr.virtualCursorPosition,
102
102
  })
@@ -110,35 +110,35 @@ export default class App extends React.Component {
110
110
  }
111
111
  ```
112
112
 
113
- ## 配置参数
113
+ ## Configuration Parameters
114
114
 
115
115
  ```javascript
116
- // `config` IAppliParams传入的 ILarkSRConfig 对象
116
+ // `config` ILarkSRConfig object passed in IAppliParams
117
117
  larksr.config;
118
- // `params` 构造函数中传入的 IAppliParams 对象
118
+ // `params` IAppliParams object passed in the constructor
119
119
  larksr.params;
120
120
  ```
121
121
 
122
- ## 用户模式
122
+ ## User Mode
123
123
 
124
124
  ```javascript
125
- // `playerModeType` 当前的玩家模式;
125
+ // `playerModeType` Current player mode;
126
126
  larksr.playerModeType;
127
- // `userType` 当前用户类型;
127
+ // `userType` Current user type;
128
128
  larksr.userType;
129
- // 当前是否是交互模式,交互默认即可以操作的模式
129
+ // Whether it is currently in interactive mode, the default interactive mode is operable
130
130
  larksr.isInteractiveMode;
131
- // 是否是观看者模式
131
+ // Whether it is observer mode
132
132
  larksr.isObMode;
133
133
  ```
134
134
 
135
- ## 当前 app 的状态
135
+ ## Current App State
136
136
 
137
137
  ```javascript
138
138
  larksr.appState;
139
139
  ```
140
140
 
141
- 具体状态值如下:
141
+ Specific state values are as follows:
142
142
 
143
143
  ```javascript
144
144
  export enum APP_STATE {
@@ -158,57 +158,57 @@ export enum APP_STATE {
158
158
  }
159
159
  ```
160
160
 
161
- 可通过事件 `APPSTATE_CHANGE = 'appstatechange'` 监听 APP_STATE 的变化
161
+ You can listen to the APP_STATE changes through the event APPSTATE_CHANGE = 'appstatechange'.
162
162
 
163
163
  ```javascript
164
164
  // create code
165
165
  ...
166
166
 
167
- // 监听连接成功事件
167
+ // Listen to the connection success event
168
168
  larksr.on('appstatechange', function(e) {
169
169
  console.log("appstatechange", e);
170
170
  });
171
171
  ```
172
172
 
173
- ## 云端画面是否准备好
173
+ ## Whether the Cloud Screen is Ready
174
174
 
175
175
  ```javascript
176
- // 云端画面是否准备好,准备好后才可以发送输入事件
176
+ // Whether the cloud screen is ready, input events can only be sent after it is ready
177
177
  larksr.remoteScreenReady
178
178
  ```
179
179
 
180
- ## 当前的屏幕状态
180
+ ## Current Screen State
181
181
 
182
182
  ```javascript
183
- // 通知视口改变或者需要重新计算显示属性
183
+ // Notify viewport change or need to recalculate display properties
184
184
  larksr.screenState.resize();
185
- // 当前云端 APP 的大小
185
+ // Current size of the cloud app
186
186
  larksr.screenState.appSize;
187
- // 当前云端 APP 的鼠标状态
187
+ // Current mouse state of the cloud app
188
188
  larksr.screenState.appMouseMode;
189
- // 当前渲染容器的大小
189
+ // Current size of the rendering container
190
190
  larksr.screenState.viewPort;
191
- // 强制横屏模式
191
+ // Force landscape mode
192
192
  larksr.screenState.screenOrientation;
193
- // 缩放模式
193
+ // Zoom mode
194
194
  larksr.screenState.scaleMode;
195
- // 是否全屏状态
195
+ // Whether it is in full screen mode
196
196
  larksr.screenState.isFullScreen;
197
- // 是否锁定鼠标状态
197
+ // Whether the mouse state is locked
198
198
  larksr.screenState.isLockMouse;
199
- // 云端应用的鼠标样式
199
+ // Mouse style of the cloud app
200
200
  larksr.screenState.cursorStyle;
201
- // 初始化鼠标模式
201
+ // Initialize mouse mode
202
202
  larksr.screenState.initCursorMode;
203
- // 是否是手机模式
203
+ // Whether it is mobile mode
204
204
  larksr.screenState.isMobile;
205
- // 是否渲染本地鼠标
205
+ // Whether to render the local mouse
206
206
  larksr.screenState.isLocalRenderMouse;
207
- // 是否锁定鼠标
207
+ // Whether to lock the mouse
208
208
  larksr.screenState.isLockMosue;
209
209
  ```
210
210
 
211
- 监听 screenState 的状态改变,事件码为 `0`。当 SDK 内部或者外部触发了 `screenState.resize()` 之后调用。
211
+ Listen to the state changes of screenState, the event code is 0. It is called after screenState.resize() is triggered internally or externally by the SDK.
212
212
 
213
213
  ```javascript
214
214
  larksr.screenState.on(0, () => {
@@ -216,123 +216,119 @@ larksr.screenState.on(0, () => {
216
216
  });
217
217
  ```
218
218
 
219
- ## 操作类实例
219
+ ## Operation Class Instances
220
220
 
221
221
  ```javascript
222
- // 开始监听,默认情况下自动开始
222
+ // Start listening, automatically starts by default
223
223
  larksr.op.startListening();
224
- // 结束监听输入事件.
224
+ // Stop listening to input events.
225
225
  larksr.op.stopListenling();
226
- // 开启或关闭鼠标输入事件
226
+ // Enable or disable mouse input events
227
227
  larksr.op.setMouseEnable(enable: boolean);
228
- // 开启或关闭键盘输入事件
228
+ // Enable or disable keyboard input events
229
229
  larksr.op.setKeyboardEnable(enable: boolean);
230
- // 开启或关闭手柄输入事件
230
+ // Enable or disable gamepad input events
231
231
  larksr.op.setGamepadEnable(enable: boolean);
232
- // 开启或关闭触摸屏幕输入事件
232
+ // Enable or disable touch screen input events
233
233
  larksr.op.setTouchEnable(enable: boolean);
234
234
  ```
235
235
 
236
- ### 操作类中的 keyboardhandler
236
+ ### Keyboard Handler in Operation Class
237
237
 
238
238
  ```javascript
239
- // 设置键盘事件默认拦截浏览器默认行为。
240
- // preventKeys 中的将拦截,如果数组设置为空则全部不拦截
241
- // 默认拦截 F1 F5 F12
239
+ // Set the default interception of keyboard events to prevent the default behavior of the browser.
240
+ // The keys in preventKeys will be intercepted, if the array is empty, all will be intercepted
241
+ // Default interception F1 F5 F12
242
242
  larksr.op.keyboardHandler.preventKeys = [["F1", "F5", "F12"]];
243
243
  ```
244
244
 
245
- ### 操作类中的 gestureHandler
245
+ ### Gesture Handler in Operation Class
246
246
 
247
- gestureHandler 处理将移动端触摸事件对应为鼠标事件的过程。
247
+ gestureHandler handles the process of converting mobile touch events to mouse events.
248
248
 
249
- #### 调节触摸事件触发参数
249
+ #### Adjust Touch Event Trigger Parameters
250
250
 
251
251
  ```javascript
252
- // 触摸事件在对应为鼠标事件中,提供的鼠标相对移动的速度。
253
- // rx = pxNew-pxOld * relativeMouseMoveSpeed
254
- // ry = pyNew-pyOld)* relativeMouseMoveSpeed
255
- // 可能会影响使用相对移动(rawInput)判断的云端应用的效果
252
+ // The speed of the mouse relative movement provided when the touch event is converted to a mouse event.
253
+ // That is, rx = (pxNew-pxOld) * relativeMouseMoveSpeed
254
+ // ry = (pyNew-pyOld) * relativeMouseMoveSpeed
255
+ // May affect the effect of cloud applications that use relative movement (rawInput) judgment
256
256
  larksr.op.gestureHandler.relativeMouseMoveSpeed = 2;
257
- // 触摸模拟为鼠标事件时,模拟点击的判断范围。
258
- // 实际的鼠标事件点击时一般不会移动,而触摸操作基本上一定会触发移动事件
259
- // 如果要模拟PC上的击事件,比如单击或双击,在鼠标按下和抬起之间不应再插入鼠标移动
260
- // 当触发移动事件时,超出该判断范围才发送移动事件。
261
- // 注意,修改该值可能会导致云端应用上判断单击或双击失败,如果云端应用不包含类似操作基本影响不大
257
+ // The judgment range for simulating clicks when touch events are converted to mouse events.
258
+ // Actual mouse events generally do not move when clicked, but touch operations will almost certainly trigger move events
259
+ // If you want to simulate click events on a PC, such as single or double clicks, no mouse move should be inserted between mouse down and up
260
+ // When a move event is triggered, a move event is sent only if it exceeds this judgment range.
261
+ // Note that modifying this value may cause single or double click failures on cloud applications, but it generally has little impact if the cloud application does not include similar operations
262
262
  larksr.op.gestureHandler.tapLimitRadius = 20;
263
- // 在该时间范围下将尝试发送单机按下事件,修改该值可能会导致单机事件的触发成功率
263
+ // Attempts to send a single click down event within this time range, modifying this value may affect the success rate of triggering single click events
264
264
  larksr.op.gestureHandler.tapLimitTimeout = 100;
265
265
  ```
266
266
 
267
- #### 拦截触摸事件回调
267
+ #### Intercept Touch Event Callback
268
268
 
269
- 可以通过拦截触摸事件回调的方式,设置具体的触摸事件和鼠标事件的对应关系。
269
+ You can set the specific correspondence between touch events and mouse events by intercepting the touch event callback.
270
270
 
271
- > 通过 larksr.op.gestureHandler.gestureCallback 设置回调函数
272
- > 下面例子中的 GESTURE_TYPE 为 SDK 导出的手势事件类型,如果用 amd 方式引入的 SDK,所有导出类型均在 larksr_websdk 全局对象下。
273
- > 如果是使用其他方式引入 SDK,如 improt 方式导入 `import { GESTURE_TYPE } from 'larksr_websdk'`
274
- > 以下示例代码忽略 larksr 创建等过程
271
+ > Set the callback function through larksr.op.gestureHandler.gestureCallback The GESTURE_TYPE in the example below is the gesture event type exported by the SDK. If the SDK is introduced in amd mode, all exported types are under the larksr_websdk global object. If the SDK is introduced in other ways, such as importing import { GESTURE_TYPE } from 'larksr_websdk' The following example code omits the larksr creation process and other code
275
272
 
276
273
  ```javascript
277
- // 参数 event 有如下字段
274
+ // The event parameter has the following fields
278
275
  // event : {
279
- // type: GESTURE_TYPE; 手势事件的类型
280
- // x: number; 转换为云端的坐标 x
281
- // y: number; 转换为云端的坐标 y
282
- // rx: number; 转换为云端的坐标 rx
283
- // ry: number; 转换为云端的坐标 ry
284
- // edge: boolean; 是否到触摸边缘
285
- // rawEvent: any; 未转换为云端坐标的触摸事件
276
+ // type: GESTURE_TYPE; Gesture event type
277
+ // x: number; Converted to cloud coordinate x
278
+ // y: number; Converted to cloud coordinate y
279
+ // rx: number; Converted to cloud coordinate rx
280
+ // ry: number; Converted to cloud coordinate ry
281
+ // edge: boolean; Whether it reaches the touch edge
282
+ // rawEvent: any; Touch event not converted to cloud coordinates
286
283
  // }
287
284
  //
288
285
  larksr.op.gestureHandler.gestureCallback = (event) => {
289
286
  console.log(event);
290
287
  const p = event;
291
288
  switch (event.type) {
292
- // 单只触摸开始移动鼠标到当前位置
289
+ // Single touch starts moving the mouse to the current position
293
290
  case GESTURE_TYPE.SINGLE_FINGER_TOUCH_START:
294
291
  larksr.mouseMove(p.x, p.y, p.rx, p.ry);
295
292
  break;
296
- // 单指单击 -》左键单击
293
+ // Single finger tap -> left mouse click
297
294
  case GESTURE_TYPE.SINGLE_FINGER_TAP:
298
295
  larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.LEFT);
299
296
  break;
300
- // 单指按下 -》 移动鼠标, 按下鼠标
297
+ // Single finger tap down -> move mouse, press mouse
301
298
  case GESTURE_TYPE.SINGLE_FINGER_TAP_DOWN:
302
299
  // move mouse first
303
300
  larksr.mouseMove(p.x, p.y, p.rx, p.ry);
304
301
  // sync tap down
305
302
  larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.LEFT);
306
303
  break;
307
- // 单指抬起 -》 移动鼠标, 抬起鼠标
304
+ // Single finger tap up -> move mouse, release mouse
308
305
  case GESTURE_TYPE.SINGLE_FINGER_TAP_UP:
309
306
  // move mouse first
310
307
  larksr.moseMove(p.x, p.y, p.rx, p.ry);
311
308
  // sync tap down
312
309
  larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.LEFT);
313
310
  break;
314
- // 单指滑动 -》 移动鼠标
311
+ // Single finger swipe -> move mouse
315
312
  case GESTURE_TYPE.SINGLE_FINGER_SWIPE:
316
313
  larksr.moseMove(p.x, p.y, p.rx, p.ry);
317
314
  break;
318
- // 单指开始滑动 -》 鼠标左键按下
315
+ // Single finger swipe start -> left mouse button down
319
316
  case GESTURE_TYPE.SINGLE_FINGER_SWIPE_START:
320
317
  // sync tap down
321
318
  larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.LEFT);
322
319
  break;
323
- // 单指滑动结束 -》 鼠标左键抬起
320
+ // Single finger swipe end -> left mouse button up
324
321
  case GESTURE_TYPE.SINGLE_FINGER_SWIPE_END:
325
322
  larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.LEFT);
326
323
  break;
327
- // 双指单击 -》 鼠标右键单击
324
+ // Double finger tap -> right mouse click
328
325
  case GESTURE_TYPE.DOUBLE_FINGER_TAP:
329
326
  larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.RIGHT);
330
327
  break;
331
- // 双指按下 -》 移动鼠标
328
+ // Double finger tap down -> move mouse
332
329
  case GESTURE_TYPE.DOUBLE_FINGER_TAP_DOWN:
333
330
  // move mouse first
334
331
  larksr.moseMove(p.x, p.y, p.rx, p.ry);
335
- // 抬起所有
336
332
  // sync tap down
337
333
  larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.RIGHT);
338
334
  break;
@@ -342,49 +338,49 @@ larksr.op.gestureHandler.gestureCallback = (event) => {
342
338
  // sync tap up
343
339
  larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.RIGHT);
344
340
  break;
345
- // 双指移动 -》 滚动滚轮
341
+ // Double finger swipe -> scroll wheel
346
342
  case GESTURE_TYPE.DOUBLE_FINGER_SWIPE:
347
343
  // move mouse mid
348
344
  // this.$emitMouseWheel(p.x, p.y, e.motion.y);
349
345
  larksr.moseMove(p.x, p.y, p.rx, p.ry);
350
346
  break;
351
347
  case GESTURE_TYPE.DOUBLE_FINGER_EXPAND:
352
- // windows 消息 deltaY 上是 +120 下是 -120
353
- // 双指扩展向外滑动
354
- // 滚轮向下移动
348
+ // Windows message deltaY up is +120 down is -120
349
+ // Double finger expand swipe outwards
350
+ // Scroll wheel down
355
351
  // move mouse mid
356
352
  larksr.mouseWheel(p.x, p.y, 120);
357
353
  break;
358
354
  case GESTURE_TYPE.DOUBLE_FINGER_SHRINK:
359
- // windows 消息 deltaY 上是 +120 下是 -120
360
- // 双指向内滑动
361
- // 滚轮向上移动
355
+ // Windows message deltaY up is +120 down is -120
356
+ // Double finger swipe inwards
357
+ // Scroll wheel up
362
358
  larksr.mouseWheel(p.x, p.y, -120);
363
359
  break;
364
360
  case GESTURE_TYPE.DOUBLE_FINGER_SWIPE_END:
365
361
  // sync tap up
366
362
  larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.RIGHT);
367
363
  break;
368
- // 三指单击 -》 鼠标中键单击
364
+ // Triple finger tap -> middle mouse click
369
365
  case GESTURE_TYPE.TRIPLE_FINGER_TAP:
370
366
  larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.MIDDLE);
371
367
  break;
372
- // 三指滑动 -》 移动鼠标
368
+ // Triple finger swipe -> move mouse
373
369
  case GESTURE_TYPE.TRIPLE_FINGER_SWIPE:
374
370
  larksr.mouseMove(p.x, p.y, p.rx, p.ry);
375
371
  break;
376
- // 三指滑动按下 -》 鼠标中键按下
372
+ // Triple finger swipe start -> middle mouse button down
377
373
  case GESTURE_TYPE.TRIPLE_FINGER_SWIPE_START:
378
374
  larksr.mouseMove(p.x, p.y, p.rx, p.ry);
379
375
  //
380
376
  larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.MIDDLE);
381
377
  break;
382
- // 三指滑动按下 -》 鼠标中键抬起
378
+ // Triple finger swipe end -> middle mouse button up
383
379
  case GESTURE_TYPE.TRIPLE_FINGER_SWIPE_END:
384
380
  // sync tap up
385
381
  larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.MIDDLE);
386
382
  break;
387
- // 所有手指抬起
383
+ // All fingers up
388
384
  case GESTURE_TYPE.RELEASE:
389
385
  break;
390
386
  default:
@@ -393,15 +389,15 @@ larksr.op.gestureHandler.gestureCallback = (event) => {
393
389
  };
394
390
  ```
395
391
 
396
- ## 全屏锁屏
392
+ ## Full Screen and Lock Screen
397
393
 
398
394
  ```javascript
399
- // 进入全屏模式
395
+ // Enter full screen mode
400
396
  larksr.fullScreen.launchFullScreen();
401
- // 退出全屏模式
397
+ // Exit full screen mode
402
398
  larksr.fullScreen.exitFullscreen();
403
- // 锁定鼠标
399
+ // Lock the mouse
404
400
  larksr.lockPointer.lockPointer();
405
- // 释放鼠标
401
+ // Release the mouse
406
402
  larksr.lockPointer.exitPointerLock();
407
403
  ```
@@ -1,26 +1,26 @@
1
1
  # 3.2.401
2
2
 
3
- > 3.2.401 多媒体通道功能在渲染服务器 3.2.2.0+ 开启
3
+ > The multimedia channel feature of version 3.2.401 is enabled on rendering server 3.2.2.0+.
4
4
 
5
- ## 3.2.401 新增功能
5
+ ## New Features in 3.2.401
6
6
 
7
- > 以下示例代码假定 `larksr` 对象初始化并连接成功。
8
- > 测试demo https://github.com/pingxingyun/lark_sr_websdk_demos/tree/gh-pages
7
+ > The following sample code assumes that the `larksr` object has been initialized and connected successfully.
8
+ > Test demo: https://github.com/ParaverseTechnology/lark_sr_websdk_demos/tree/gh-pages
9
9
 
10
- (1). 新增多路 Web 端上传媒体功能。使用 `larksr.getMediaSharePeerConnection(index)` 获取上传媒体通道。
10
+ (1). Added multi-channel media upload feature for the Web. Use `larksr.getMediaSharePeerConnection(index)` to get the media upload channel.
11
11
 
12
- 序号 index 支持 0 - 5, 获取媒体通道之后的打开媒体操作和之前的接口相同。原有的接口等同于 `getMediaSharePeerConnection(0)`
12
+ The index supports 0 - 5. The media operations after obtaining the media channel are the same as the previous interface. The original interface is equivalent to `getMediaSharePeerConnection(0)`.
13
13
 
14
- 使用方式如
14
+ Usage example:
15
15
 
16
16
  ```javascript
17
17
  larksr.getMediaSharePeerConnection(0).openVideo();
18
18
  larksr.getMediaSharePeerConnection(0).closeVideo();
19
19
  ```
20
20
 
21
- > 连接不支持多通道上传的老版本渲染服务器时,仅通道 0 起作用。
21
+ > When connecting to an older version of the rendering server that does not support multi-channel upload, only channel 0 will work.
22
22
 
23
- (2). 获取具体通道的连接状态 `getStats`
23
+ (2). Get the connection status of a specific channel using `getStats`
24
24
 
25
25
  ```javascript
26
26
  larksr.getMediaSharePeerConnection(0).getStats()
@@ -32,16 +32,16 @@ larksr.getMediaSharePeerConnection(0).getStats()
32
32
  })
33
33
  ```
34
34
 
35
- (3). 设置具体连接通道的视频编码 `preferVideoCode`
35
+ (3). Set the video encoding for a specific connection channel using `preferVideoCode`
36
36
 
37
37
  ```javascript
38
38
  larksr.getMediaSharePeerConnection(0).preferVideoCode = 'h264';
39
39
  ```
40
40
 
41
- > 当当前浏览器支持所设定的视频编码时优先使用,如果不支持使用默认的编码方式
42
- > 设置完成之后再次打开视频起效,已经打开的视频通不会有变化。
41
+ > If the current browser supports the specified video encoding, it will be used preferentially. If not, the default encoding method will be used.
42
+ > The setting will take effect the next time the video is opened. The already opened video will not change.
43
43
 
44
- (4). 设置具体连接通道的视频上传码率
44
+ (4). Set the video upload bitrate for a specific connection channel
45
45
 
46
46
  ```javascript
47
47
  larksr.getMediaSharePeerConnection(0).codeRate = {
@@ -51,9 +51,9 @@ larksr.getMediaSharePeerConnection(0).codeRate = {
51
51
  }
52
52
  ```
53
53
 
54
- > 设置完成之后再次打开视频起效,已经打开的视频通不会有变化。
54
+ > The setting will take effect the next time the video is opened. The already opened video will not change.
55
55
 
56
- (5). 媒体连接通道可以单独监听事件,如
56
+ (5). Media connection channels can listen to events separately, for example:
57
57
 
58
58
  ```javascript
59
59
  larksr.getMediaSharePeerConnection(0).on("rtc_state_change", function(e) {
@@ -61,24 +61,24 @@ larksr.getMediaSharePeerConnection(0).on("rtc_state_change", function(e) {
61
61
  });
62
62
  ```
63
63
 
64
- (6). 打开或保存下来的媒体通道对象有单独的id, 0 - 5
64
+ (6). The opened or saved media channel object has a separate id, 0 - 5
65
65
 
66
66
  ```javascript
67
67
  larksr.getMediaSharePeerConnection(0).id
68
68
  ```
69
69
 
70
- (7). 强制使用画布模式,视频通道的画布可以顺时针或者逆时针旋转画面
70
+ (7). Force the use of canvas mode, the canvas of the video channel can rotate the screen clockwise or counterclockwise
71
71
 
72
- 开启旋转
72
+ Enable rotation
73
73
 
74
74
  ```javascript
75
75
  larksr.getMediaSharePeerConnection(0).forceRenderToCanvas = true;
76
76
  ```
77
77
 
78
- 强制顺时针旋转
78
+ Force clockwise rotation
79
79
 
80
80
  ```javascript
81
81
  larksr.getMediaSharePeerConnection(0).canvasRender.setRotate(true);
82
82
  ```
83
83
 
84
- > 设置完成之后再次打开视频起效,已经打开的视频通不会有变化。
84
+ > The setting will take effect the next time the video is opened. The already opened video will not change.
@@ -1,28 +1,28 @@
1
- # SDK ID 加密配置
1
+ # SDK ID Encryption Configuration
2
2
 
3
- 使用 larksr SDK 首先需要从平行云商务 business@pingxingyun.com 或者在 https://www.pingxingyun.com/console 获取 SDK 授权码(注意不是服务器端的授权码)。
3
+ To use the larksr SDK, you first need to obtain an SDK authorization code from Pingxingyun Business (business@pingxingyun.com) or at https://www.pingxingyun.com/console (note that this is not the server-side authorization code).
4
4
 
5
- 通过 larksr config 传入 `authCode` 或者通过 larksr.initSDKAuthCode('您的SDKID') 方法设置授权码。
5
+ Pass the `authCode` through larksr config or set the authorization code using the method `larksr.initSDKAuthCode('YourSDKID')`.
6
6
 
7
- 为保护 SDK ID 的安全性,可以从服务端 3.2.3.0 开始可以对 SDK ID 进行加密配置。
7
+ To protect the security of the SDK ID, from server version 3.2.3.0 onwards, you can configure SDK ID encryption.
8
8
 
9
- 配置 SDK 加密:
9
+ Configure SDK encryption:
10
10
 
11
- 1. 首先在 larkxr 平台后台登陆,找到系统设定->接入管理->SDKID密钥管理生成 SDK ID 加密 KEY
11
+ 1. First, log in to the larkxr platform backend, find System Settings -> Access Management -> SDKID Key Management to generate an SDK ID encryption key.
12
12
 
13
- 2. SDK ID 进行加密
13
+ 2. Encrypt the SDK ID
14
14
 
15
- 以下 java 代码为例:
15
+ The following is an example in Java:
16
16
 
17
17
  ```java
18
18
  public static void main(String[] args) {
19
19
  /**
20
- * @param res 被加密的原生字符串
21
- * @param key 16位字符作为加密的key
20
+ * @param res The original string to be encrypted
21
+ * @param key 16-character key for encryption
22
22
  */
23
23
  try {
24
- String res = "被加密的原生字符串";
25
- String key = "16位字符作为加密的key";
24
+ String res = "The original string to be encrypted";
25
+ String key = "16-character key for encryption";
26
26
  String ALGORITHM = "AES";
27
27
  String CHARSET = "UTF-8";
28
28
  SecretKeySpec sks = new SecretKeySpec(key.getBytes(CHARSET), ALGORITHM);
@@ -32,9 +32,9 @@ public static void main(String[] args) {
32
32
  // BASE64Encoder encoder = new BASE64Encoder(); //java8
33
33
  Base64.Encoder encoder = Base64.getEncoder(); //java9+
34
34
  System.out.println(encoder.encodeToString(result));
35
- }catch (Exception e){
35
+ } catch (Exception e) {
36
36
  }
37
37
  }
38
38
  ```
39
39
 
40
- 3. 获取到加密好的字符串传入 lark 配置中即可。
40
+ 3. Pass the encrypted string into the lark configuration.