larksr_websdk 3.3.102 → 3.3.104
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.
- package/dist/doc/en/config.md +99 -99
- package/dist/doc/en/dev.md +21 -21
- package/dist/doc/en/event_codes.md +117 -117
- package/dist/doc/en/events.md +72 -72
- package/dist/doc/en/functions.md +239 -239
- package/dist/doc/en/index.md +1 -1
- package/dist/doc/en/member_variables.md +116 -120
- package/dist/doc/en/multi_media_3_2_401.md +20 -20
- package/dist/doc/en/sdkid_encryption.md +14 -14
- package/dist/doc/en/update.md +462 -462
- package/dist/doc/zh_CN/config.md +1 -1
- package/dist/doc/zh_CN/event_codes.md +1 -1
- package/dist/doc/zh_CN/functions.md +2 -2
- package/dist/doc/zh_CN/index.md +1 -1
- package/dist/doc/zh_CN/multi_media_3_2_401.md +1 -1
- package/dist/doc/zh_CN/update.md +579 -579
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +2 -0
- package/dist/types/appli_params.d.ts +14 -0
- package/dist/types/lark/application.d.ts +2 -1
- package/dist/types/lark/message.d.ts +1 -0
- package/dist/types/larksr.d.ts +83 -4
- package/dist/types/localization/ui.d.ts +2 -0
- package/dist/types/operation/keyboard_handler.d.ts +25 -0
- package/dist/types/utils/lock_pointer.d.ts +2 -1
- package/package.json +72 -72
- package/types/api.d.ts +2 -0
- package/types/appli_params.d.ts +14 -0
- package/types/lark/application.d.ts +2 -1
- package/types/lark/message.d.ts +1 -0
- package/types/larksr.d.ts +83 -4
- package/types/localization/ui.d.ts +2 -0
- package/types/operation/keyboard_handler.d.ts +25 -0
- package/types/utils/lock_pointer.d.ts +2 -1
- package/dist/types/lark/custom.d.ts +0 -7
- package/dist/types/lark/webcodecs.generated.d.ts +0 -417
- package/dist/types/protobuf/cloudlark.d.ts +0 -9674
- package/dist/types/utils/ios-inner-height.d.ts +0 -4
- package/types/lark/custom.d.ts +0 -7
- package/types/lark/webcodecs.generated.d.ts +0 -417
- package/types/protobuf/cloudlark.d.ts +0 -9674
- package/types/utils/ios-inner-height.d.ts +0 -4
package/dist/doc/en/index.md
CHANGED
|
@@ -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/
|
|
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
|
-
>
|
|
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
|
-
|
|
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
|
-
//
|
|
18
|
+
// Get the <video /> video element being played
|
|
19
19
|
larksr.videoComponent.getVideo();
|
|
20
|
-
//
|
|
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
|
-
//
|
|
26
|
+
// Capture a frame, return base64, and throw a screenshot success event
|
|
27
27
|
larksr.videoComponent.captrueFrame(data);
|
|
28
28
|
```
|
|
29
29
|
|
|
30
|
-
2.
|
|
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
|
-
*
|
|
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
|
-
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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`
|
|
116
|
+
// `config` ILarkSRConfig object passed in IAppliParams
|
|
117
117
|
larksr.config;
|
|
118
|
-
//
|
|
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
|
-
##
|
|
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
|
-
|
|
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
|
-
//
|
|
185
|
+
// Current size of the cloud app
|
|
186
186
|
larksr.screenState.appSize;
|
|
187
|
-
//
|
|
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
|
-
|
|
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
|
-
###
|
|
236
|
+
### Keyboard Handler in Operation Class
|
|
237
237
|
|
|
238
238
|
```javascript
|
|
239
|
-
//
|
|
240
|
-
//
|
|
241
|
-
//
|
|
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
|
-
###
|
|
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
|
-
//
|
|
254
|
-
//
|
|
255
|
-
//
|
|
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
|
-
//
|
|
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
|
-
>
|
|
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
|
-
//
|
|
274
|
+
// The event parameter has the following fields
|
|
278
275
|
// event : {
|
|
279
|
-
// type: GESTURE_TYPE;
|
|
280
|
-
// x: number;
|
|
281
|
-
// y: number;
|
|
282
|
-
// rx: number;
|
|
283
|
-
// ry: number;
|
|
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
|
-
//
|
|
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
|
-
//
|
|
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
|
+
> 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
|
-
>
|
|
8
|
-
>
|
|
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).
|
|
10
|
+
(1). Added multi-channel media upload feature for the Web. Use `larksr.getMediaSharePeerConnection(index)` to get the media upload channel.
|
|
11
11
|
|
|
12
|
-
|
|
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
|
-
>
|
|
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).
|
|
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).
|
|
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).
|
|
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
|
-
|
|
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
|
-
|
|
5
|
+
Pass the `authCode` through larksr config or set the authorization code using the method `larksr.initSDKAuthCode('YourSDKID')`.
|
|
6
6
|
|
|
7
|
-
|
|
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
|
-
|
|
9
|
+
Configure SDK encryption:
|
|
10
10
|
|
|
11
|
-
1.
|
|
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.
|
|
13
|
+
2. Encrypt the SDK ID
|
|
14
14
|
|
|
15
|
-
|
|
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
|
|
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
|
|
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.
|
|
40
|
+
3. Pass the encrypted string into the lark configuration.
|