larksr_websdk 3.3.112 → 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.
Files changed (35) hide show
  1. package/dist/doc/en/config.md +228 -228
  2. package/dist/doc/en/dev.md +83 -83
  3. package/dist/doc/en/event_codes.md +286 -286
  4. package/dist/doc/en/events.md +229 -229
  5. package/dist/doc/en/functions.md +603 -603
  6. package/dist/doc/en/index.md +115 -115
  7. package/dist/doc/en/member_variables.md +403 -403
  8. package/dist/doc/en/multi_media_3_2_401.md +83 -83
  9. package/dist/doc/en/sdkid_encryption.md +40 -40
  10. package/dist/doc/en/update.md +462 -462
  11. package/dist/doc/zh_CN/update.md +579 -579
  12. package/dist/larksr-web-sdk.min.js +1 -1
  13. package/dist/types/api.d.ts +1 -1
  14. package/dist/types/event/event_base.d.ts +1 -1
  15. package/dist/types/lark/application.d.ts +3 -1
  16. package/dist/types/lark/peer_connection.d.ts +7 -1
  17. package/dist/types/larksr.d.ts +5 -1
  18. package/dist/types/operation/keymap.d.ts +1 -1
  19. package/dist/types/protobuf/cloudlark.d.ts +3 -9926
  20. package/dist/types/screen_state.d.ts +1 -1
  21. package/package.json +72 -72
  22. package/types/api.d.ts +1 -1
  23. package/types/event/event_base.d.ts +1 -1
  24. package/types/lark/application.d.ts +3 -1
  25. package/types/lark/peer_connection.d.ts +7 -1
  26. package/types/larksr.d.ts +5 -1
  27. package/types/operation/keymap.d.ts +1 -1
  28. package/types/protobuf/cloudlark.d.ts +3 -9926
  29. package/types/screen_state.d.ts +1 -1
  30. package/dist/types/lark/custom.d.ts +0 -7
  31. package/dist/types/lark/webcodecs.generated.d.ts +0 -417
  32. package/dist/types/utils/ios-inner-height.d.ts +0 -4
  33. package/types/lark/custom.d.ts +0 -7
  34. package/types/lark/webcodecs.generated.d.ts +0 -417
  35. package/types/utils/ios-inner-height.d.ts +0 -4
@@ -1,228 +1,228 @@
1
- # LarkSR Object Parameters
2
-
3
- The parameters for creating a LarkSR object are as follows:
4
-
5
- ```typescript
6
- /**
7
- * LarkSR Configuration Interface
8
- */
9
- interface ILarkSRConfig {
10
- /**
11
- * Required. Root element. The component will be mounted under the root element.
12
- * Note: *Do not* set it to document.documentElement.
13
- * In default mode, the root element will be rotated to enforce landscape mode.
14
- * @see handleRootElementSize
15
- * @see scaleMode
16
- */
17
- rootElement: HTMLElement;
18
- /**
19
- * Optional. Server address. The address for accessing the LarkServer frontend.
20
- * Example: http://192.168.0.55:8181/
21
- * When using managed services, the server address is automatically assigned and can be left empty.
22
- * When using managed services, @see CreateLarkSRClientFromePXYHost @see larksr.connectWithPxyHost
23
- */
24
- serverAddress?: string;
25
- /**
26
- * Optional. SDK authorization code. If not provided here, it must be initialized in the instance later by calling initSDKAuthCode.
27
- */
28
- authCode?: string;
29
- /**
30
- * Optional. Whether the authorization is successful.
31
- * @deprecated This parameter is currently not called back. If SDK verification fails, it will return a failure in connect.
32
- */
33
- authCodeCallback?: (isSuccess: boolean, e: any) => void;
34
- /**
35
- * Optional. Background image URL during loading.
36
- */
37
- loadingBgUrl?: string;
38
- /**
39
- * Optional. Whether to synchronize the size style of the root component.
40
- * Enabled by default, setting the root component size to the browser viewport size.
41
- * If disabled, the internal components will be displayed according to the size of the passed root element.
42
- * Note: When disabled, the root element will not be automatically filled. If the root element height is 0, it will not be displayed.
43
- * Note: When disabled, mobileForceLandscape will lose its effect.
44
- */
45
- handleRootElementSize?: boolean;
46
- /**
47
- * Same as handleRootElementSize.
48
- */
49
- handelRootElementSize?: boolean;
50
- /**
51
- * Whether to only set the rotation of the root component. Only effective when handleRootElementSize is true. Sets the rotation of the root component for mobileForceLandscape mode.
52
- * Default is false. In this case, the SDK will set the width, height, margin 0, and padding 0 of the root component.
53
- * When true and handleRootElementSize is also true, only the rotation attribute of the root component is set, used for forced landscape mode and switching between forced landscape and portrait modes.
54
- * Note: When onlyHandleRootElementTransform is successfully enabled, ensure the size of the root element and call the resize method to notify the update of the root element size when the root element changes.
55
- */
56
- onlyHandleRootElementTransform?: boolean;
57
- /**
58
- * Whether to listen to mouse, keyboard, and other input events within the SDK.
59
- * If disabled, input events need to be sent manually.
60
- * Note: When disabled, full-screen mode and lock mode will be invalid and need to be triggered externally.
61
- * @see fullScreenMode
62
- */
63
- handlInput?: boolean;
64
- /**
65
- * Whether to attempt muted playback when video autoplay fails. An event will be thrown when muted playback occurs.
66
- * When the user interacts with the screen during muted playback, it will attempt to play sound.
67
- */
68
- mutePlayWhenFailed?: boolean;
69
- /**
70
- * Optional. Whether it is a VR monitoring type.
71
- */
72
- isMonitor?: boolean;
73
- /**
74
- * Optional. Bitrate.
75
- */
76
- codeRate?: number;
77
- /**
78
- * Optional. Frame rate.
79
- */
80
- frameRate?: number;
81
- /**
82
- * Optional. Audio frame rate.
83
- */
84
- audioCodeRate?: number;
85
- /**
86
- * Optional. Log level. Default is warn.
87
- */
88
- logLevel?: 'info' | 'warn' | 'error';
89
- /**
90
- * Optional. Loading timeout. Default is 60s. Loading stops after this time.
91
- */
92
- loadingTimeout?: number;
93
- /**
94
- * Optional. Whether to automatically synchronize clipboard data.
95
- */
96
- syncLocalToCloudClipboard?: boolean;
97
- /**
98
- * Optional. Preferred video codec format.
99
- */
100
- preferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
101
- /**
102
- * Optional. Video scaling mode within the container.
103
- * ScaleMode: 'contain' | 'fill_clip' | 'fill_stretch'
104
- * contain: Scales with the original size of the application.
105
- * fill_clip: Crop mode, fully fills the screen while maintaining aspect ratio.
106
- * fill_stretch: Stretch mode, fully fills the screen without maintaining aspect ratio.
107
- * Corresponds to the initial display mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
108
- */
109
- scaleMode?: ScaleMode;
110
- /**
111
- * Full-screen mode.
112
- * 0 -》 Manually triggered by the user.
113
- * 1 -》 Triggered on the first click.
114
- * 2 -》 Triggered on every click.
115
- * Corresponds to the full-screen mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
116
- */
117
- fullScreenMode?: number;
118
- /**
119
- * Optional. Full-screen mode on mobile devices, same values as fullScreenMode.
120
- * Corresponds to the full-screen mode in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
121
- */
122
- mobileFullScreenMode?: number;
123
- /**
124
- * Optional. Whether to force landscape mode on mobile devices.
125
- * Corresponds to whether to force landscape mode on mobile devices in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
126
- */
127
- mobileForceLandscape?: boolean;
128
- /**
129
- * Optional.
130
- * Initial mouse mode, 0 for automatic detection, 1 for locked, 2 for unlocked.
131
- * Corresponds to the initial mouse mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
132
- */
133
- initCursorMode?: boolean;
134
- /**
135
- * Optional.
136
- * External port mapping of the rendering server.
137
- * Format: key=[Rendering Server IP:PORT] value=[External IP:PORT]
138
- * {
139
- * "RENDER-A-IP:RENDER-A-PORT1": "PUBLIC-A-IP:PORT1",
140
- * "RENDER-B-IP:RENDER-B-PORT1": "PUBLIC-A-IP:PORT2",
141
- * "RENDER-C-IP:RENDER-C-PORT1": "PUBLIC-A-IP:PORT3",
142
- * "RENDER-D-IP:RENDER-D-PORT1": "PUBLIC-B-IP:PORT1",
143
- * "RENDER-E-IP:RENDER-E-PORT1": "PUBLIC-B-IP:PORT2",
144
- * "RENDER-E-IP:RENDER-E-PORT2": "PUBLIC-C-IP:PORT1",
145
- * }
146
- */
147
- publicPortMapping?: PublicPortMapping;
148
- /**
149
- * Optional.
150
- * Whether to prompt for text input APP_REQUEST_INPUT.
151
- * When the server detects an input method event, an event will be thrown. You can add an input box on the web layer and use inputText to send text to the cloud.
152
- * Enabled by default. When manually disabled, the APP_REQUEST_INPUT event will not be thrown.
153
- */
154
- textInputEventPrompt?: boolean;
155
- /**
156
- * Optional.
157
- * Whether to automatically connect to audio devices when the audio input feature is enabled.
158
- * Disabled by default.
159
- * Note that the default audio device of the system is enabled by default.
160
- */
161
- audioInputAutoStart?: boolean;
162
- /**
163
- * Optional.
164
- * Whether to automatically connect to video devices when the video input feature is enabled.
165
- * Disabled by default.
166
- * Note that the default video device of the system is enabled by default.
167
- */
168
- videoInputAutoStart?: boolean;
169
- /**
170
- * Optional.
171
- * mouseZoomDirection
172
- * Used for the correspondence between pinch zoom operations on mobile devices and application mouse zoom.
173
- * 1: Mouse wheel up to zoom in,
174
- * 0: Mouse wheel down to zoom in (default).
175
- */
176
- mouseZoomDirection?: number;
177
- /**
178
- * Optional.
179
- * Touch operation mode, whether the touch operation on mobile devices corresponds to the touch screen or mouse on the cloud.
180
- * 'touchScreen' | 'mouse'
181
- * Touch operation mode, corresponds to the touch operation mode in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
182
- */
183
- touchOperateMode?: 'touchScreen' | 'mouse';
184
- /**
185
- * Optional.
186
- * Prefer to use the external IP for peer-to-peer connection of the rendering server.
187
- * If configured, it will override the preferPublicIp parameter set in the backend.
188
- */
189
- preferPublicIp?: string;
190
- /**
191
- * Optional.
192
- * Whether to autoplay. Enabled by default.
193
- * If disabled, there will be a prompt UI after a successful connection, and the user needs to trigger it manually.
194
- * Enabling autoplay does not guarantee that all browsers will autoplay successfully. When playback fails or the browser does not support autoplay,
195
- * a play button will be displayed, and the user needs to click the play button to play manually.
196
- */
197
- autoPlay?: boolean;
198
- /**
199
- * Optional.
200
- * Whether to display the play button in case of playback failure or manual playback mode.
201
- * Enabled by default. Note that if disabled, you need to add prompts or UI to guide the user to click play.
202
- * In the UI, the user needs to trigger larksr.videoComponent.playVideo();
203
- */
204
- showPlayButton?: boolean;
205
- /**
206
- * Optional.
207
- * Language settings, currently only supports Chinese and English, default is Chinese.
208
- * zh-CN for Chinese, en for English.
209
- */
210
- language?: string;
211
- /**
212
- * Timeout for receiving video streams or successful playback after a successful peer-to-peer connection. In autoplay mode, a prompt button will pop up after the timeout.
213
- * Default is 20s.
214
- */
215
- playTimeout?: number;
216
- /**
217
- * Whether to use the new camera/microphone protocol.
218
- * Separate upload process requires rendering server version greater than 3290.
219
- */
220
- useSeparateMediaSharePeer?: boolean;
221
- /**
222
- * Whether to enable canvas rendering. Disabled by default.
223
- * Note that enabling canvas on mobile devices will consume additional performance.
224
- * Known issue: On iOS, when canvas mode is disabled, the stretch mode that ignores the aspect ratio is invalid.
225
- */
226
- enableCanvasRender?: boolean;
227
- }
228
- ```
1
+ # LarkSR Object Parameters
2
+
3
+ The parameters for creating a LarkSR object are as follows:
4
+
5
+ ```typescript
6
+ /**
7
+ * LarkSR Configuration Interface
8
+ */
9
+ interface ILarkSRConfig {
10
+ /**
11
+ * Required. Root element. The component will be mounted under the root element.
12
+ * Note: *Do not* set it to document.documentElement.
13
+ * In default mode, the root element will be rotated to enforce landscape mode.
14
+ * @see handleRootElementSize
15
+ * @see scaleMode
16
+ */
17
+ rootElement: HTMLElement;
18
+ /**
19
+ * Optional. Server address. The address for accessing the LarkServer frontend.
20
+ * Example: http://192.168.0.55:8181/
21
+ * When using managed services, the server address is automatically assigned and can be left empty.
22
+ * When using managed services, @see CreateLarkSRClientFromePXYHost @see larksr.connectWithPxyHost
23
+ */
24
+ serverAddress?: string;
25
+ /**
26
+ * Optional. SDK authorization code. If not provided here, it must be initialized in the instance later by calling initSDKAuthCode.
27
+ */
28
+ authCode?: string;
29
+ /**
30
+ * Optional. Whether the authorization is successful.
31
+ * @deprecated This parameter is currently not called back. If SDK verification fails, it will return a failure in connect.
32
+ */
33
+ authCodeCallback?: (isSuccess: boolean, e: any) => void;
34
+ /**
35
+ * Optional. Background image URL during loading.
36
+ */
37
+ loadingBgUrl?: string;
38
+ /**
39
+ * Optional. Whether to synchronize the size style of the root component.
40
+ * Enabled by default, setting the root component size to the browser viewport size.
41
+ * If disabled, the internal components will be displayed according to the size of the passed root element.
42
+ * Note: When disabled, the root element will not be automatically filled. If the root element height is 0, it will not be displayed.
43
+ * Note: When disabled, mobileForceLandscape will lose its effect.
44
+ */
45
+ handleRootElementSize?: boolean;
46
+ /**
47
+ * Same as handleRootElementSize.
48
+ */
49
+ handelRootElementSize?: boolean;
50
+ /**
51
+ * Whether to only set the rotation of the root component. Only effective when handleRootElementSize is true. Sets the rotation of the root component for mobileForceLandscape mode.
52
+ * Default is false. In this case, the SDK will set the width, height, margin 0, and padding 0 of the root component.
53
+ * When true and handleRootElementSize is also true, only the rotation attribute of the root component is set, used for forced landscape mode and switching between forced landscape and portrait modes.
54
+ * Note: When onlyHandleRootElementTransform is successfully enabled, ensure the size of the root element and call the resize method to notify the update of the root element size when the root element changes.
55
+ */
56
+ onlyHandleRootElementTransform?: boolean;
57
+ /**
58
+ * Whether to listen to mouse, keyboard, and other input events within the SDK.
59
+ * If disabled, input events need to be sent manually.
60
+ * Note: When disabled, full-screen mode and lock mode will be invalid and need to be triggered externally.
61
+ * @see fullScreenMode
62
+ */
63
+ handlInput?: boolean;
64
+ /**
65
+ * Whether to attempt muted playback when video autoplay fails. An event will be thrown when muted playback occurs.
66
+ * When the user interacts with the screen during muted playback, it will attempt to play sound.
67
+ */
68
+ mutePlayWhenFailed?: boolean;
69
+ /**
70
+ * Optional. Whether it is a VR monitoring type.
71
+ */
72
+ isMonitor?: boolean;
73
+ /**
74
+ * Optional. Bitrate.
75
+ */
76
+ codeRate?: number;
77
+ /**
78
+ * Optional. Frame rate.
79
+ */
80
+ frameRate?: number;
81
+ /**
82
+ * Optional. Audio frame rate.
83
+ */
84
+ audioCodeRate?: number;
85
+ /**
86
+ * Optional. Log level. Default is warn.
87
+ */
88
+ logLevel?: 'info' | 'warn' | 'error';
89
+ /**
90
+ * Optional. Loading timeout. Default is 60s. Loading stops after this time.
91
+ */
92
+ loadingTimeout?: number;
93
+ /**
94
+ * Optional. Whether to automatically synchronize clipboard data.
95
+ */
96
+ syncLocalToCloudClipboard?: boolean;
97
+ /**
98
+ * Optional. Preferred video codec format.
99
+ */
100
+ preferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
101
+ /**
102
+ * Optional. Video scaling mode within the container.
103
+ * ScaleMode: 'contain' | 'fill_clip' | 'fill_stretch'
104
+ * contain: Scales with the original size of the application.
105
+ * fill_clip: Crop mode, fully fills the screen while maintaining aspect ratio.
106
+ * fill_stretch: Stretch mode, fully fills the screen without maintaining aspect ratio.
107
+ * Corresponds to the initial display mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
108
+ */
109
+ scaleMode?: ScaleMode;
110
+ /**
111
+ * Full-screen mode.
112
+ * 0 -》 Manually triggered by the user.
113
+ * 1 -》 Triggered on the first click.
114
+ * 2 -》 Triggered on every click.
115
+ * Corresponds to the full-screen mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
116
+ */
117
+ fullScreenMode?: number;
118
+ /**
119
+ * Optional. Full-screen mode on mobile devices, same values as fullScreenMode.
120
+ * Corresponds to the full-screen mode in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
121
+ */
122
+ mobileFullScreenMode?: number;
123
+ /**
124
+ * Optional. Whether to force landscape mode on mobile devices.
125
+ * Corresponds to whether to force landscape mode on mobile devices in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
126
+ */
127
+ mobileForceLandscape?: boolean;
128
+ /**
129
+ * Optional.
130
+ * Initial mouse mode, 0 for automatic detection, 1 for locked, 2 for unlocked.
131
+ * Corresponds to the initial mouse mode in the backend application management -> application editing -> general advanced settings. This configuration has a higher priority than the backend configuration.
132
+ */
133
+ initCursorMode?: boolean;
134
+ /**
135
+ * Optional.
136
+ * External port mapping of the rendering server.
137
+ * Format: key=[Rendering Server IP:PORT] value=[External IP:PORT]
138
+ * {
139
+ * "RENDER-A-IP:RENDER-A-PORT1": "PUBLIC-A-IP:PORT1",
140
+ * "RENDER-B-IP:RENDER-B-PORT1": "PUBLIC-A-IP:PORT2",
141
+ * "RENDER-C-IP:RENDER-C-PORT1": "PUBLIC-A-IP:PORT3",
142
+ * "RENDER-D-IP:RENDER-D-PORT1": "PUBLIC-B-IP:PORT1",
143
+ * "RENDER-E-IP:RENDER-E-PORT1": "PUBLIC-B-IP:PORT2",
144
+ * "RENDER-E-IP:RENDER-E-PORT2": "PUBLIC-C-IP:PORT1",
145
+ * }
146
+ */
147
+ publicPortMapping?: PublicPortMapping;
148
+ /**
149
+ * Optional.
150
+ * Whether to prompt for text input APP_REQUEST_INPUT.
151
+ * When the server detects an input method event, an event will be thrown. You can add an input box on the web layer and use inputText to send text to the cloud.
152
+ * Enabled by default. When manually disabled, the APP_REQUEST_INPUT event will not be thrown.
153
+ */
154
+ textInputEventPrompt?: boolean;
155
+ /**
156
+ * Optional.
157
+ * Whether to automatically connect to audio devices when the audio input feature is enabled.
158
+ * Disabled by default.
159
+ * Note that the default audio device of the system is enabled by default.
160
+ */
161
+ audioInputAutoStart?: boolean;
162
+ /**
163
+ * Optional.
164
+ * Whether to automatically connect to video devices when the video input feature is enabled.
165
+ * Disabled by default.
166
+ * Note that the default video device of the system is enabled by default.
167
+ */
168
+ videoInputAutoStart?: boolean;
169
+ /**
170
+ * Optional.
171
+ * mouseZoomDirection
172
+ * Used for the correspondence between pinch zoom operations on mobile devices and application mouse zoom.
173
+ * 1: Mouse wheel up to zoom in,
174
+ * 0: Mouse wheel down to zoom in (default).
175
+ */
176
+ mouseZoomDirection?: number;
177
+ /**
178
+ * Optional.
179
+ * Touch operation mode, whether the touch operation on mobile devices corresponds to the touch screen or mouse on the cloud.
180
+ * 'touchScreen' | 'mouse'
181
+ * Touch operation mode, corresponds to the touch operation mode in the backend application management -> application editing -> mobile advanced settings. This configuration has a higher priority than the backend configuration.
182
+ */
183
+ touchOperateMode?: 'touchScreen' | 'mouse';
184
+ /**
185
+ * Optional.
186
+ * Prefer to use the external IP for peer-to-peer connection of the rendering server.
187
+ * If configured, it will override the preferPublicIp parameter set in the backend.
188
+ */
189
+ preferPublicIp?: string;
190
+ /**
191
+ * Optional.
192
+ * Whether to autoplay. Enabled by default.
193
+ * If disabled, there will be a prompt UI after a successful connection, and the user needs to trigger it manually.
194
+ * Enabling autoplay does not guarantee that all browsers will autoplay successfully. When playback fails or the browser does not support autoplay,
195
+ * a play button will be displayed, and the user needs to click the play button to play manually.
196
+ */
197
+ autoPlay?: boolean;
198
+ /**
199
+ * Optional.
200
+ * Whether to display the play button in case of playback failure or manual playback mode.
201
+ * Enabled by default. Note that if disabled, you need to add prompts or UI to guide the user to click play.
202
+ * In the UI, the user needs to trigger larksr.videoComponent.playVideo();
203
+ */
204
+ showPlayButton?: boolean;
205
+ /**
206
+ * Optional.
207
+ * Language settings, currently only supports Chinese and English, default is Chinese.
208
+ * zh-CN for Chinese, en for English.
209
+ */
210
+ language?: string;
211
+ /**
212
+ * Timeout for receiving video streams or successful playback after a successful peer-to-peer connection. In autoplay mode, a prompt button will pop up after the timeout.
213
+ * Default is 20s.
214
+ */
215
+ playTimeout?: number;
216
+ /**
217
+ * Whether to use the new camera/microphone protocol.
218
+ * Separate upload process requires rendering server version greater than 3290.
219
+ */
220
+ useSeparateMediaSharePeer?: boolean;
221
+ /**
222
+ * Whether to enable canvas rendering. Disabled by default.
223
+ * Note that enabling canvas on mobile devices will consume additional performance.
224
+ * Known issue: On iOS, when canvas mode is disabled, the stretch mode that ignores the aspect ratio is invalid.
225
+ */
226
+ enableCanvasRender?: boolean;
227
+ }
228
+ ```
@@ -1,84 +1,84 @@
1
- # Dev Branch Current Version 3.2.4-dev.0.1
2
-
3
- > The Dev branch includes unreleased server-side features. Used for testing and debugging.
4
-
5
- ## New Features in 3.2.4-dev.0.1
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 on the Web. Use `larksr.getMediaSharePeerConnection(index)` to get the media upload channel.
11
-
12
- The index supports 0 - 5. The operations for opening media 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 connected to older versions of the rendering server that do not support multi-channel uploads, 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 codec 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 codec, it will be used preferentially. If not, the default codec will be used.
42
- > The setting will take effect the next time the video is opened. The already opened video channel 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 channel will not change.
55
-
56
- (5). Media connection channels can listen to events individually, 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 unique id, 0 - 5
65
-
66
- ```javascript
67
- larksr.getMediaSharePeerConnection(0).id
68
- ```
69
-
70
- (7). Force the use of canvas mode, and the video channel's canvas can rotate the image 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
+ # Dev Branch Current Version 3.2.4-dev.0.1
2
+
3
+ > The Dev branch includes unreleased server-side features. Used for testing and debugging.
4
+
5
+ ## New Features in 3.2.4-dev.0.1
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 on the Web. Use `larksr.getMediaSharePeerConnection(index)` to get the media upload channel.
11
+
12
+ The index supports 0 - 5. The operations for opening media 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 connected to older versions of the rendering server that do not support multi-channel uploads, 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 codec 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 codec, it will be used preferentially. If not, the default codec will be used.
42
+ > The setting will take effect the next time the video is opened. The already opened video channel 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 channel will not change.
55
+
56
+ (5). Media connection channels can listen to events individually, 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 unique id, 0 - 5
65
+
66
+ ```javascript
67
+ larksr.getMediaSharePeerConnection(0).id
68
+ ```
69
+
70
+ (7). Force the use of canvas mode, and the video channel's canvas can rotate the image 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 channel will not change.