larksr_websdk 3.3.104 → 3.3.106

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 (129) hide show
  1. package/package.json +72 -72
  2. package/dist/doc/en/config.md +0 -228
  3. package/dist/doc/en/dev.md +0 -84
  4. package/dist/doc/en/event_codes.md +0 -286
  5. package/dist/doc/en/events.md +0 -229
  6. package/dist/doc/en/functions.md +0 -603
  7. package/dist/doc/en/index.md +0 -115
  8. package/dist/doc/en/member_variables.md +0 -403
  9. package/dist/doc/en/multi_media_3_2_401.md +0 -84
  10. package/dist/doc/en/sdkid_encryption.md +0 -40
  11. package/dist/doc/en/update.md +0 -462
  12. package/dist/doc/zh_CN/config.md +0 -243
  13. package/dist/doc/zh_CN/event_codes.md +0 -286
  14. package/dist/doc/zh_CN/events.md +0 -229
  15. package/dist/doc/zh_CN/functions.md +0 -658
  16. package/dist/doc/zh_CN/index.md +0 -84
  17. package/dist/doc/zh_CN/member_variables.md +0 -431
  18. package/dist/doc/zh_CN/multi_media_3_2_401.md +0 -84
  19. package/dist/doc/zh_CN/sdkid_encryption.md +0 -40
  20. package/dist/doc/zh_CN/update.md +0 -579
  21. package/dist/larksr-web-sdk.min.js +0 -1
  22. package/dist/types/api.d.ts +0 -155
  23. package/dist/types/appli_params.d.ts +0 -323
  24. package/dist/types/common/cmd.d.ts +0 -28
  25. package/dist/types/common/constant.d.ts +0 -4
  26. package/dist/types/common/interface.d.ts +0 -30
  27. package/dist/types/config.d.ts +0 -58
  28. package/dist/types/event/event_base.d.ts +0 -11
  29. package/dist/types/event/iframe_poster.d.ts +0 -9
  30. package/dist/types/index.d.ts +0 -23
  31. package/dist/types/lark/Worker.d.ts +0 -3
  32. package/dist/types/lark/application.d.ts +0 -224
  33. package/dist/types/lark/canvas_render.d.ts +0 -28
  34. package/dist/types/lark/ice_candiadate_parser.d.ts +0 -24
  35. package/dist/types/lark/lark_event_type.d.ts +0 -114
  36. package/dist/types/lark/media_share_interface.d.ts +0 -47
  37. package/dist/types/lark/message.d.ts +0 -23
  38. package/dist/types/lark/peer_connection.d.ts +0 -203
  39. package/dist/types/lark/peer_connection_media_share.d.ts +0 -156
  40. package/dist/types/lark/recoder.d.ts +0 -55
  41. package/dist/types/lark/sdp_util.d.ts +0 -39
  42. package/dist/types/lark/test_pixel_streaming.d.ts +0 -54
  43. package/dist/types/lark/webcodec.d.ts +0 -61
  44. package/dist/types/lark/websocket_channel.d.ts +0 -58
  45. package/dist/types/lark/websocket_proxy.d.ts +0 -58
  46. package/dist/types/lark/websocket_waitqueue.d.ts +0 -36
  47. package/dist/types/larksr.d.ts +0 -1411
  48. package/dist/types/localization/base.d.ts +0 -8
  49. package/dist/types/localization/gesture_ins.d.ts +0 -4
  50. package/dist/types/localization/language.d.ts +0 -7
  51. package/dist/types/localization/loader.d.ts +0 -14
  52. package/dist/types/localization/message.d.ts +0 -82
  53. package/dist/types/localization/ui.d.ts +0 -62
  54. package/dist/types/operation/gamepad_handler.d.ts +0 -67
  55. package/dist/types/operation/gesture.d.ts +0 -72
  56. package/dist/types/operation/gesture_handler.d.ts +0 -53
  57. package/dist/types/operation/handler_base.d.ts +0 -8
  58. package/dist/types/operation/keyboard_handler.d.ts +0 -46
  59. package/dist/types/operation/keymap.d.ts +0 -24
  60. package/dist/types/operation/letter_keymap.d.ts +0 -8
  61. package/dist/types/operation/mouse_handler.d.ts +0 -42
  62. package/dist/types/operation/num_keymap.d.ts +0 -12
  63. package/dist/types/operation/operation.d.ts +0 -102
  64. package/dist/types/operation/pixel_streaming_input.d.ts +0 -82
  65. package/dist/types/operation/touch_handler.d.ts +0 -11
  66. package/dist/types/operation/utils.d.ts +0 -18
  67. package/dist/types/screen_state.d.ts +0 -133
  68. package/dist/types/utils/browser_type.d.ts +0 -37
  69. package/dist/types/utils/capabilities.d.ts +0 -54
  70. package/dist/types/utils/full_screen.d.ts +0 -25
  71. package/dist/types/utils/lock_pointer.d.ts +0 -25
  72. package/dist/types/utils/log.d.ts +0 -25
  73. package/dist/types/utils/scale_mode.d.ts +0 -70
  74. package/dist/types/utils/unit.d.ts +0 -154
  75. package/dist/types/utils/webgl_utils.d.ts +0 -48
  76. package/types/api.d.ts +0 -155
  77. package/types/appli_params.d.ts +0 -323
  78. package/types/common/cmd.d.ts +0 -28
  79. package/types/common/constant.d.ts +0 -4
  80. package/types/common/interface.d.ts +0 -30
  81. package/types/config.d.ts +0 -58
  82. package/types/event/event_base.d.ts +0 -11
  83. package/types/event/iframe_poster.d.ts +0 -9
  84. package/types/index.d.ts +0 -23
  85. package/types/lark/Worker.d.ts +0 -3
  86. package/types/lark/application.d.ts +0 -224
  87. package/types/lark/canvas_render.d.ts +0 -28
  88. package/types/lark/ice_candiadate_parser.d.ts +0 -24
  89. package/types/lark/lark_event_type.d.ts +0 -114
  90. package/types/lark/media_share_interface.d.ts +0 -47
  91. package/types/lark/message.d.ts +0 -23
  92. package/types/lark/peer_connection.d.ts +0 -203
  93. package/types/lark/peer_connection_media_share.d.ts +0 -156
  94. package/types/lark/recoder.d.ts +0 -55
  95. package/types/lark/sdp_util.d.ts +0 -39
  96. package/types/lark/test_pixel_streaming.d.ts +0 -54
  97. package/types/lark/webcodec.d.ts +0 -61
  98. package/types/lark/websocket_channel.d.ts +0 -58
  99. package/types/lark/websocket_proxy.d.ts +0 -58
  100. package/types/lark/websocket_waitqueue.d.ts +0 -36
  101. package/types/larksr.d.ts +0 -1411
  102. package/types/localization/base.d.ts +0 -8
  103. package/types/localization/gesture_ins.d.ts +0 -4
  104. package/types/localization/language.d.ts +0 -7
  105. package/types/localization/loader.d.ts +0 -14
  106. package/types/localization/message.d.ts +0 -82
  107. package/types/localization/ui.d.ts +0 -62
  108. package/types/operation/gamepad_handler.d.ts +0 -67
  109. package/types/operation/gesture.d.ts +0 -72
  110. package/types/operation/gesture_handler.d.ts +0 -53
  111. package/types/operation/handler_base.d.ts +0 -8
  112. package/types/operation/keyboard_handler.d.ts +0 -46
  113. package/types/operation/keymap.d.ts +0 -24
  114. package/types/operation/letter_keymap.d.ts +0 -8
  115. package/types/operation/mouse_handler.d.ts +0 -42
  116. package/types/operation/num_keymap.d.ts +0 -12
  117. package/types/operation/operation.d.ts +0 -102
  118. package/types/operation/pixel_streaming_input.d.ts +0 -82
  119. package/types/operation/touch_handler.d.ts +0 -11
  120. package/types/operation/utils.d.ts +0 -18
  121. package/types/screen_state.d.ts +0 -133
  122. package/types/utils/browser_type.d.ts +0 -37
  123. package/types/utils/capabilities.d.ts +0 -54
  124. package/types/utils/full_screen.d.ts +0 -25
  125. package/types/utils/lock_pointer.d.ts +0 -25
  126. package/types/utils/log.d.ts +0 -25
  127. package/types/utils/scale_mode.d.ts +0 -70
  128. package/types/utils/unit.d.ts +0 -154
  129. package/types/utils/webgl_utils.d.ts +0 -48
@@ -1,115 +0,0 @@
1
- # LarkSR WebClient SDK
2
-
3
- Develop webclient for LarkSR cloudrending or LarkSR VR monitor client. Free design UI and define operate.
4
-
5
- Links:
6
-
7
- [Paraverse](https://www.paraverse.cc/)
8
-
9
- [LarkSR Doc](https://www.pingxingyun.com/devCenter.html)
10
-
11
- [Experience](https://www.paraverse.cc/)
12
-
13
- SDK include:
14
-
15
- * LarkSR restful request.
16
- * CloudRending Video.
17
- * Handle input, keyboard, gamepad, touchscreen.
18
- * Scale mode.
19
- * Fullscreen mode.
20
- * Landscap mode.
21
-
22
- ### Notice
23
-
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/ParaverseTechnology/lark_sr_websdk_demos/releases/tag/V3.2.10)
26
- > V3.2.314 server and datachannel above 3.2.5.1
27
-
28
- ## Quick Start
29
-
30
- ### install
31
-
32
- 1. npm
33
-
34
- ```cmd
35
- npm i larksr_websdk
36
- ```
37
-
38
- 2. plain html
39
-
40
- ```html
41
- <script src="larksr-web-sdk.min.js"></script>
42
- ```
43
-
44
- ### Use
45
-
46
- Import websdk with plain html SDK under global object larksr_websdk.
47
-
48
- Connect cloud resource and all event access with new LarkSR object.
49
-
50
- > SDK default config html 100% height 100% width viewport. Auto handle input.
51
-
52
- > SDK mainly contain loading page and cloud video page no other ui.efore start:
53
-
54
- 1. Lark SR server address, exp:http://222.128.6.137:8181/
55
- 2. SDK auth code,connect business@pingxingyun.com or register https://www.pingxingyun.com/console/#/
56
- 3. App id from Lark SR admin server applist.
57
-
58
- ```javascript
59
- var client = new LarkSR({
60
- // root html element
61
- // WARNING not document.documentElement
62
- rootElement: document.getElementById('container'),
63
- // Sever address
64
- serverAddress: "Lark Sever address",
65
- // SDK ID or set by call initSDKAuthCode
66
- // authCode: 'your SDK ID',
67
- // test backgroud url
68
- // loadingBgUrl: 'https://home-obs.pingxingyun.com/homePage_4_0/bg.jpg',
69
- });
70
- ```
71
-
72
- Set sdk auth code.
73
-
74
- ```javascript
75
- client.initSDKAuthCode('Your SDK ID')
76
- .then(() => {
77
- // start connect;
78
- client.connect({
79
- // LarkSR cloud appid from LarkSR admin server.
80
- // doc
81
- // https://www.pingxingyun.com/online/api3_2.html?id=476
82
- appliId: "appid from LarkSR admin"
83
- })
84
- .then(() => {
85
- console.log('enter success');
86
- })
87
- .catch((e) => {
88
- console.error(e);
89
- });
90
- })
91
- .catch((e) => {
92
- console.error(e);
93
- });
94
- // ...
95
- // close connection.
96
- // client.close();
97
- // release DOM element.
98
- // client.destroy();
99
- ```
100
-
101
- ### Doc
102
-
103
- [LarkSR WebClient SDK](https://pingxingyun.github.io/en/webclient_sdk/)
104
-
105
-
106
- ## Index
107
-
108
- ### [Config](./config.md)
109
- ### [LarkSR functions](./functions.md)
110
- ### [LarkSR events](./events.md)
111
- ### [LarkSR event codes](./event_codes.md)
112
- ### [LarkSR member varibales](./member_variables.md)
113
- ### [SDK ID encryption](./sdkid_encryption.md)
114
- ### [Multi media share](./multi_media_3_2_401.md)
115
- ### [SDK Update](./update.md)
@@ -1,403 +0,0 @@
1
- # LarkSR Object Member Variables
2
-
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
-
5
- > In the following code, `larksr` is an instance of the created LarkSR object. The creation process is omitted.
6
-
7
- ```javascript
8
- let larksr;
9
-
10
- // ... create code.
11
- ```
12
-
13
- ## Video Component
14
-
15
- 1. `videoComponent` Video Component
16
-
17
- ```javascript
18
- // Get the <video /> video element being played
19
- larksr.videoComponent.getVideo();
20
- // Play the video, async method throws an exception if playback fails
21
- larksr.videoComponent.playVideo();
22
- // Stop video playback
23
- larksr.videoComponent.stopVideo();
24
- // Play video sound, unmute playback
25
- larksr.videoComponent.sountPlayout();
26
- // Capture a frame, return base64, and throw a screenshot success event
27
- larksr.videoComponent.captrueFrame(data);
28
- ```
29
-
30
- 2. videoElement HTML video video element itself
31
-
32
- ```javascript
33
- larksr.videoElement;
34
- ```
35
-
36
- 3. Control Display Elements
37
-
38
- ```javascript
39
- // Whether to show touch points on mobile
40
- larksr.isEnableTouchPoint = false;
41
- // Whether to show bottom text during loading screen
42
- larksr.isEnableLoadingStateBar = false;
43
- ```
44
-
45
- ```javascript
46
- // Set zoom mode
47
- larksr.scaleMode = ScaleMode.CONTAIN_APP;
48
- ```
49
-
50
- 4. Virtual Mouse and Touch Points
51
-
52
- ```javascript
53
- /**
54
- * Current position of the virtual mouse, relative to the overall container
55
- */
56
- larksr.virtualCursorPosition
57
- /**
58
- * Current position of the virtual mouse, internal zoom container, same as the actual display virtual mouse CSS style
59
- */
60
- larksr.virtualCursorPositionRaw
61
- ```
62
-
63
- Example:
64
-
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
-
67
- ```javascript
68
- // ....
69
- // Omitted React creation code
70
- export default class App extends React.Component {
71
- private state: any = {
72
- pointPosition: {
73
- x: 0,
74
- y: 0,
75
- }
76
- };
77
- // ....
78
- // Omitted larksr creation process and other code
79
- render() {
80
- return (
81
- <div>
82
- // ...
83
- // Omitted other elements
84
- <div style={{
85
- zIndex: 1000,
86
- position: 'absolute',
87
- left: this.state.pointPosition.x,
88
- top: this.state.pointPosition.y,
89
- backgroundColor: "red",
90
- width: 50,
91
- height: 50,
92
- borderRadius: "50%"
93
- }}>
94
- </div>
95
- <button style={{pointerEvents: "all"}}
96
- onClick={()=>{
97
- // Get the position of the virtual mouse
98
- console.log("touch point", this.larksr.virtualCursorPosition);
99
- // Synchronize the position of the virtual mouse
100
- this.setState({
101
- pointPosition: this.larksr.virtualCursorPosition,
102
- })
103
- }}
104
- >
105
- touchPoint
106
- </button>
107
- </div>
108
- )
109
- }
110
- }
111
- ```
112
-
113
- ## Configuration Parameters
114
-
115
- ```javascript
116
- // `config` ILarkSRConfig object passed in IAppliParams
117
- larksr.config;
118
- // `params` IAppliParams object passed in the constructor
119
- larksr.params;
120
- ```
121
-
122
- ## User Mode
123
-
124
- ```javascript
125
- // `playerModeType` Current player mode;
126
- larksr.playerModeType;
127
- // `userType` Current user type;
128
- larksr.userType;
129
- // Whether it is currently in interactive mode, the default interactive mode is operable
130
- larksr.isInteractiveMode;
131
- // Whether it is observer mode
132
- larksr.isObMode;
133
- ```
134
-
135
- ## Current App State
136
-
137
- ```javascript
138
- larksr.appState;
139
- ```
140
-
141
- Specific state values are as follows:
142
-
143
- ```javascript
144
- export enum APP_STATE {
145
- BEFORE_CREATE = 0,
146
- INITED,
147
- WEBSOCKET_CHANNEL_OPEN,
148
- LOGIN_SUCCESS,
149
- RTC_CONNECTED,
150
- MEDIA_LOADED,
151
- MEDIA_PLAED,
152
- RTC_RETRY,
153
- APP_RETRY,
154
- BEFORE_DESTORY,
155
- WEBSOCKET_CLOSED,
156
- RTC_CLOSED,
157
- DESTROYED,
158
- }
159
- ```
160
-
161
- You can listen to the APP_STATE changes through the event APPSTATE_CHANGE = 'appstatechange'.
162
-
163
- ```javascript
164
- // create code
165
- ...
166
-
167
- // Listen to the connection success event
168
- larksr.on('appstatechange', function(e) {
169
- console.log("appstatechange", e);
170
- });
171
- ```
172
-
173
- ## Whether the Cloud Screen is Ready
174
-
175
- ```javascript
176
- // Whether the cloud screen is ready, input events can only be sent after it is ready
177
- larksr.remoteScreenReady
178
- ```
179
-
180
- ## Current Screen State
181
-
182
- ```javascript
183
- // Notify viewport change or need to recalculate display properties
184
- larksr.screenState.resize();
185
- // Current size of the cloud app
186
- larksr.screenState.appSize;
187
- // Current mouse state of the cloud app
188
- larksr.screenState.appMouseMode;
189
- // Current size of the rendering container
190
- larksr.screenState.viewPort;
191
- // Force landscape mode
192
- larksr.screenState.screenOrientation;
193
- // Zoom mode
194
- larksr.screenState.scaleMode;
195
- // Whether it is in full screen mode
196
- larksr.screenState.isFullScreen;
197
- // Whether the mouse state is locked
198
- larksr.screenState.isLockMouse;
199
- // Mouse style of the cloud app
200
- larksr.screenState.cursorStyle;
201
- // Initialize mouse mode
202
- larksr.screenState.initCursorMode;
203
- // Whether it is mobile mode
204
- larksr.screenState.isMobile;
205
- // Whether to render the local mouse
206
- larksr.screenState.isLocalRenderMouse;
207
- // Whether to lock the mouse
208
- larksr.screenState.isLockMosue;
209
- ```
210
-
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
-
213
- ```javascript
214
- larksr.screenState.on(0, () => {
215
- console.log("screen state resize", larksr.screenState.screenOrientation);
216
- });
217
- ```
218
-
219
- ## Operation Class Instances
220
-
221
- ```javascript
222
- // Start listening, automatically starts by default
223
- larksr.op.startListening();
224
- // Stop listening to input events.
225
- larksr.op.stopListenling();
226
- // Enable or disable mouse input events
227
- larksr.op.setMouseEnable(enable: boolean);
228
- // Enable or disable keyboard input events
229
- larksr.op.setKeyboardEnable(enable: boolean);
230
- // Enable or disable gamepad input events
231
- larksr.op.setGamepadEnable(enable: boolean);
232
- // Enable or disable touch screen input events
233
- larksr.op.setTouchEnable(enable: boolean);
234
- ```
235
-
236
- ### Keyboard Handler in Operation Class
237
-
238
- ```javascript
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
- larksr.op.keyboardHandler.preventKeys = [["F1", "F5", "F12"]];
243
- ```
244
-
245
- ### Gesture Handler in Operation Class
246
-
247
- gestureHandler handles the process of converting mobile touch events to mouse events.
248
-
249
- #### Adjust Touch Event Trigger Parameters
250
-
251
- ```javascript
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
- larksr.op.gestureHandler.relativeMouseMoveSpeed = 2;
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
- larksr.op.gestureHandler.tapLimitRadius = 20;
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
- larksr.op.gestureHandler.tapLimitTimeout = 100;
265
- ```
266
-
267
- #### Intercept Touch Event Callback
268
-
269
- You can set the specific correspondence between touch events and mouse events by intercepting the touch event callback.
270
-
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
272
-
273
- ```javascript
274
- // The event parameter has the following fields
275
- // event : {
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
283
- // }
284
- //
285
- larksr.op.gestureHandler.gestureCallback = (event) => {
286
- console.log(event);
287
- const p = event;
288
- switch (event.type) {
289
- // Single touch starts moving the mouse to the current position
290
- case GESTURE_TYPE.SINGLE_FINGER_TOUCH_START:
291
- larksr.mouseMove(p.x, p.y, p.rx, p.ry);
292
- break;
293
- // Single finger tap -> left mouse click
294
- case GESTURE_TYPE.SINGLE_FINGER_TAP:
295
- larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.LEFT);
296
- break;
297
- // Single finger tap down -> move mouse, press mouse
298
- case GESTURE_TYPE.SINGLE_FINGER_TAP_DOWN:
299
- // move mouse first
300
- larksr.mouseMove(p.x, p.y, p.rx, p.ry);
301
- // sync tap down
302
- larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.LEFT);
303
- break;
304
- // Single finger tap up -> move mouse, release mouse
305
- case GESTURE_TYPE.SINGLE_FINGER_TAP_UP:
306
- // move mouse first
307
- larksr.moseMove(p.x, p.y, p.rx, p.ry);
308
- // sync tap down
309
- larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.LEFT);
310
- break;
311
- // Single finger swipe -> move mouse
312
- case GESTURE_TYPE.SINGLE_FINGER_SWIPE:
313
- larksr.moseMove(p.x, p.y, p.rx, p.ry);
314
- break;
315
- // Single finger swipe start -> left mouse button down
316
- case GESTURE_TYPE.SINGLE_FINGER_SWIPE_START:
317
- // sync tap down
318
- larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.LEFT);
319
- break;
320
- // Single finger swipe end -> left mouse button up
321
- case GESTURE_TYPE.SINGLE_FINGER_SWIPE_END:
322
- larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.LEFT);
323
- break;
324
- // Double finger tap -> right mouse click
325
- case GESTURE_TYPE.DOUBLE_FINGER_TAP:
326
- larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.RIGHT);
327
- break;
328
- // Double finger tap down -> move mouse
329
- case GESTURE_TYPE.DOUBLE_FINGER_TAP_DOWN:
330
- // move mouse first
331
- larksr.moseMove(p.x, p.y, p.rx, p.ry);
332
- // sync tap down
333
- larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.RIGHT);
334
- break;
335
- case GESTURE_TYPE.DOUBLE_FINGER_TAP_UP:
336
- // move mouse first
337
- larksr.moseMove(p.x, p.y, p.rx, p.ry);
338
- // sync tap up
339
- larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.RIGHT);
340
- break;
341
- // Double finger swipe -> scroll wheel
342
- case GESTURE_TYPE.DOUBLE_FINGER_SWIPE:
343
- // move mouse mid
344
- // this.$emitMouseWheel(p.x, p.y, e.motion.y);
345
- larksr.moseMove(p.x, p.y, p.rx, p.ry);
346
- break;
347
- case GESTURE_TYPE.DOUBLE_FINGER_EXPAND:
348
- // Windows message deltaY up is +120 down is -120
349
- // Double finger expand swipe outwards
350
- // Scroll wheel down
351
- // move mouse mid
352
- larksr.mouseWheel(p.x, p.y, 120);
353
- break;
354
- case GESTURE_TYPE.DOUBLE_FINGER_SHRINK:
355
- // Windows message deltaY up is +120 down is -120
356
- // Double finger swipe inwards
357
- // Scroll wheel up
358
- larksr.mouseWheel(p.x, p.y, -120);
359
- break;
360
- case GESTURE_TYPE.DOUBLE_FINGER_SWIPE_END:
361
- // sync tap up
362
- larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.RIGHT);
363
- break;
364
- // Triple finger tap -> middle mouse click
365
- case GESTURE_TYPE.TRIPLE_FINGER_TAP:
366
- larksr.mouseTap(p.x, p.y, CloudLark.MouseKey.MIDDLE);
367
- break;
368
- // Triple finger swipe -> move mouse
369
- case GESTURE_TYPE.TRIPLE_FINGER_SWIPE:
370
- larksr.mouseMove(p.x, p.y, p.rx, p.ry);
371
- break;
372
- // Triple finger swipe start -> middle mouse button down
373
- case GESTURE_TYPE.TRIPLE_FINGER_SWIPE_START:
374
- larksr.mouseMove(p.x, p.y, p.rx, p.ry);
375
- //
376
- larksr.mouseDown(p.x, p.y, CloudLark.MouseKey.MIDDLE);
377
- break;
378
- // Triple finger swipe end -> middle mouse button up
379
- case GESTURE_TYPE.TRIPLE_FINGER_SWIPE_END:
380
- // sync tap up
381
- larksr.mouseUp(p.x, p.y, CloudLark.MouseKey.MIDDLE);
382
- break;
383
- // All fingers up
384
- case GESTURE_TYPE.RELEASE:
385
- break;
386
- default:
387
- break;
388
- }
389
- };
390
- ```
391
-
392
- ## Full Screen and Lock Screen
393
-
394
- ```javascript
395
- // Enter full screen mode
396
- larksr.fullScreen.launchFullScreen();
397
- // Exit full screen mode
398
- larksr.fullScreen.exitFullscreen();
399
- // Lock the mouse
400
- larksr.lockPointer.lockPointer();
401
- // Release the mouse
402
- larksr.lockPointer.exitPointerLock();
403
- ```
@@ -1,84 +0,0 @@
1
- # 3.2.401
2
-
3
- > The multimedia channel feature of version 3.2.401 is enabled on rendering server 3.2.2.0+.
4
-
5
- ## New Features in 3.2.401
6
-
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
-
10
- (1). Added multi-channel media upload feature for the Web. Use `larksr.getMediaSharePeerConnection(index)` to get the media upload channel.
11
-
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
-
14
- Usage example:
15
-
16
- ```javascript
17
- larksr.getMediaSharePeerConnection(0).openVideo();
18
- larksr.getMediaSharePeerConnection(0).closeVideo();
19
- ```
20
-
21
- > When connecting to an older version of the rendering server that does not support multi-channel upload, only channel 0 will work.
22
-
23
- (2). Get the connection status of a specific channel using `getStats`
24
-
25
- ```javascript
26
- larksr.getMediaSharePeerConnection(0).getStats()
27
- .then((res) => {
28
- console.log("state: ", res);
29
- })
30
- .catch((e) => {
31
- console.log("get state failed", e);
32
- })
33
- ```
34
-
35
- (3). Set the video encoding for a specific connection channel using `preferVideoCode`
36
-
37
- ```javascript
38
- larksr.getMediaSharePeerConnection(0).preferVideoCode = 'h264';
39
- ```
40
-
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
-
44
- (4). Set the video upload bitrate for a specific connection channel
45
-
46
- ```javascript
47
- larksr.getMediaSharePeerConnection(0).codeRate = {
48
- start: 1000,
49
- min: 1000,
50
- max: 20000,
51
- }
52
- ```
53
-
54
- > The setting will take effect the next time the video is opened. The already opened video will not change.
55
-
56
- (5). Media connection channels can listen to events separately, for example:
57
-
58
- ```javascript
59
- larksr.getMediaSharePeerConnection(0).on("rtc_state_change", function(e) {
60
- console.log("ice state change", e);
61
- });
62
- ```
63
-
64
- (6). The opened or saved media channel object has a separate id, 0 - 5
65
-
66
- ```javascript
67
- larksr.getMediaSharePeerConnection(0).id
68
- ```
69
-
70
- (7). Force the use of canvas mode, the canvas of the video channel can rotate the screen clockwise or counterclockwise
71
-
72
- Enable rotation
73
-
74
- ```javascript
75
- larksr.getMediaSharePeerConnection(0).forceRenderToCanvas = true;
76
- ```
77
-
78
- Force clockwise rotation
79
-
80
- ```javascript
81
- larksr.getMediaSharePeerConnection(0).canvasRender.setRotate(true);
82
- ```
83
-
84
- > The setting will take effect the next time the video is opened. The already opened video will not change.
@@ -1,40 +0,0 @@
1
- # SDK ID Encryption Configuration
2
-
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
-
5
- Pass the `authCode` through larksr config or set the authorization code using the method `larksr.initSDKAuthCode('YourSDKID')`.
6
-
7
- To protect the security of the SDK ID, from server version 3.2.3.0 onwards, you can configure SDK ID encryption.
8
-
9
- Configure SDK encryption:
10
-
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
-
13
- 2. Encrypt the SDK ID
14
-
15
- The following is an example in Java:
16
-
17
- ```java
18
- public static void main(String[] args) {
19
- /**
20
- * @param res The original string to be encrypted
21
- * @param key 16-character key for encryption
22
- */
23
- try {
24
- String res = "The original string to be encrypted";
25
- String key = "16-character key for encryption";
26
- String ALGORITHM = "AES";
27
- String CHARSET = "UTF-8";
28
- SecretKeySpec sks = new SecretKeySpec(key.getBytes(CHARSET), ALGORITHM);
29
- Cipher cipher = Cipher.getInstance(ALGORITHM);
30
- cipher.init(cipher.ENCRYPT_MODE, sks);
31
- byte[] result = cipher.doFinal(res.getBytes());
32
- // BASE64Encoder encoder = new BASE64Encoder(); //java8
33
- Base64.Encoder encoder = Base64.getEncoder(); //java9+
34
- System.out.println(encoder.encodeToString(result));
35
- } catch (Exception e) {
36
- }
37
- }
38
- ```
39
-
40
- 3. Pass the encrypted string into the lark configuration.