larksr_websdk 3.3.113 → 3.3.114
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 +228 -228
- package/dist/doc/en/dev.md +83 -83
- package/dist/doc/en/event_codes.md +286 -286
- package/dist/doc/en/events.md +229 -229
- package/dist/doc/en/functions.md +603 -603
- package/dist/doc/en/index.md +115 -115
- package/dist/doc/en/member_variables.md +403 -403
- package/dist/doc/en/multi_media_3_2_401.md +83 -83
- package/dist/doc/en/sdkid_encryption.md +40 -40
- package/dist/doc/en/update.md +462 -462
- package/dist/doc/zh_CN/update.md +579 -579
- package/dist/larksr-web-sdk.min.js +1 -1
- package/dist/types/api.d.ts +1 -1
- package/dist/types/event/event_base.d.ts +1 -1
- package/dist/types/larksr.d.ts +1 -1
- package/dist/types/operation/keymap.d.ts +1 -1
- package/dist/types/protobuf/cloudlark.d.ts +3 -10160
- package/dist/types/screen_state.d.ts +1 -1
- package/package.json +72 -72
- package/types/api.d.ts +1 -1
- package/types/event/event_base.d.ts +1 -1
- package/types/larksr.d.ts +1 -1
- package/types/operation/keymap.d.ts +1 -1
- package/types/protobuf/cloudlark.d.ts +3 -10160
- package/types/screen_state.d.ts +1 -1
- package/dist/types/lark/custom.d.ts +0 -7
- package/dist/types/lark/webcodecs.generated.d.ts +0 -417
- 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/utils/ios-inner-height.d.ts +0 -4
|
@@ -1,84 +1,84 @@
|
|
|
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
|
-
|
|
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
84
|
> The setting will take effect the next time the video is opened. The already opened video will not change.
|
|
@@ -1,40 +1,40 @@
|
|
|
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.
|
|
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.
|