larksr_websdk 3.2.317 → 3.2.320

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.
@@ -35,6 +35,9 @@ export interface GetTaskResult {
35
35
  wm: number;
36
36
  textInputEventPrompt: number;
37
37
  audioInput: number;
38
+ audioInputAutoStart: number;
39
+ videoInput: number;
40
+ videoInputAutoStart: number;
38
41
  }
39
42
  export interface StartAppInfo {
40
43
  appliId: string;
@@ -172,7 +172,7 @@ export interface IAppliParams {
172
172
  /**
173
173
  * 优先使用的解码器
174
174
  */
175
- perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
175
+ preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
176
176
  /**
177
177
  * 触摸操作对应的操作方式,触摸屏还是鼠标
178
178
  */
@@ -193,6 +193,8 @@ export interface IAppliParams {
193
193
  textInputEventPrompt: boolean;
194
194
  audioInput: boolean;
195
195
  audioInputAutoStart: boolean;
196
+ videoInput: boolean;
197
+ videoInputAutoStart: boolean;
196
198
  }
197
199
  export declare enum AppliType {
198
200
  DESKTOP = 1,
@@ -243,7 +245,7 @@ export declare class AppliParams implements IAppliParams {
243
245
  mobileVirtualJoystick: boolean;
244
246
  mouseZoomDirection: number;
245
247
  showPlayerList: boolean;
246
- perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
248
+ preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
247
249
  touchOperateMode: 'touchScreen' | 'mouse';
248
250
  appliId: string;
249
251
  syncLocalToCloudClipboard: boolean;
@@ -255,6 +257,8 @@ export declare class AppliParams implements IAppliParams {
255
257
  textInputEventPrompt: boolean;
256
258
  audioInput: boolean;
257
259
  audioInputAutoStart: boolean;
260
+ videoInput: boolean;
261
+ videoInputAutoStart: boolean;
258
262
  static copyAndCreate(params?: IAppliParams): AppliParams;
259
263
  static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
260
264
  }
@@ -59,6 +59,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
59
59
  private _state;
60
60
  get audioDeviceId(): string | undefined;
61
61
  get audioTrack(): MediaStreamTrack | undefined;
62
+ get videoDeviceId(): string | undefined;
63
+ get videoTrack(): MediaStreamTrack | undefined;
62
64
  private retryTime;
63
65
  private larksr;
64
66
  get voiceId(): number;
@@ -98,6 +98,8 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
98
98
  private videoStream;
99
99
  get audioDeviceId(): string | undefined;
100
100
  get audioTrack(): MediaStreamTrack | undefined;
101
+ get videoDeviceId(): string | undefined;
102
+ get videoTrack(): MediaStreamTrack | undefined;
101
103
  private localAudioTrackBinding;
102
104
  private localVideoTrackBinding;
103
105
  private localShareTrackBinding;
@@ -277,7 +277,7 @@ interface ILarkSRConfig {
277
277
  /**
278
278
  * 可选项,优选选择的视频编码格式
279
279
  */
280
- perferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
280
+ preferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
281
281
  /**
282
282
  * 可选项,视频在容器中的缩放模式
283
283
  *
@@ -324,9 +324,15 @@ interface ILarkSRConfig {
324
324
  /**
325
325
  * 当启用音频输入功能,是否自动连入音频设备。
326
326
  * 默认关闭。
327
- * 需要注意默认打开的时系统中默认的音频设备。
327
+ * 需要注意默认打开的是系统中默认的音频设备。
328
328
  */
329
329
  audioInputAutoStart?: boolean;
330
+ /**
331
+ * 当启用视频输入功能,是否自动连入视频设备。
332
+ * 默认关闭。
333
+ * 需要注意默认打开的是系统中默认的视频设备。
334
+ */
335
+ videoInputAutoStart?: boolean;
330
336
  }
331
337
  declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
332
338
  /**
@@ -462,6 +468,14 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
462
468
  * 当前打开音频的track对象,未打开状态为空
463
469
  */
464
470
  get audioTrack(): MediaStreamTrack | undefined;
471
+ /**
472
+ * 当前打开视频设备 ID,如果打开时没指定特设备id为空
473
+ */
474
+ get videoDeviceId(): string | undefined;
475
+ /**
476
+ * 当前打开视频track对象,未打开状态为空
477
+ */
478
+ get videoTrack(): MediaStreamTrack | undefined;
465
479
  /**
466
480
  * LarkSR 客户端。所有操作和事件通过该类传递
467
481
  * @param config 本地配置,优先级最高
@@ -782,6 +796,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
782
796
  * @returns
783
797
  */
784
798
  setAudioEnable(enable: boolean): void | undefined;
799
+ /**
800
+ * 设置当前已开启的视频track是否启用状态
801
+ * @param enable 是否启用
802
+ * @returns
803
+ */
785
804
  setVideoEnable(enable: boolean): void | undefined;
786
805
  setShareEnable(enable: boolean): void | undefined;
787
806
  /**
@@ -794,24 +813,41 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
794
813
  /**
795
814
  * 打开一个音频设备,要注意浏览器限制在 https 或者 localhost 下才能打开音频
796
815
  * @param deviceId 音频设备id,如果不传将打开默认设备。@see getConnectedAudioinputDevices
797
- * @returns
816
+ * @returns Promise
798
817
  */
799
818
  openAudio(deviceId?: string): Promise<{
800
819
  streams: MediaStream;
801
820
  rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
802
821
  } | undefined>;
822
+ /**
823
+ * 打开一个视频设备,要注意浏览器限制在 https 或者 localhost 下才能打开视频
824
+ * @param audio boolean 是否同时开启音频
825
+ * @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
826
+ * @returns Promise
827
+ */
803
828
  openVideo(audio?: boolean, cameraId?: string): Promise<{
804
829
  streams: MediaStream;
805
830
  rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
806
831
  } | undefined>;
832
+ /**
833
+ * 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
834
+ * 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
835
+ * @param video 是否包含视频
836
+ * @param audio 是否包含音频
837
+ * @returns Promise
838
+ */
807
839
  openDefaultMedia(video?: boolean, audio?: boolean): Promise<void | undefined>;
808
840
  openShareMediaDevice(): Promise<void | undefined>;
809
841
  /**
810
842
  * 返回已连接的音频设备列表,设备列表中的设备的 deviceId 可用来打开某个音频设备
811
- * @returns
843
+ * @returns Promise<MediaDeviceInfo[]>
812
844
  */
813
845
  getConnectedAudioinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
814
846
  getConnectedAudioOutputDevices(): Promise<MediaDeviceInfo[] | undefined>;
847
+ /**
848
+ * 返回已连接的视频设备
849
+ * @returns Promise<MediaDeviceInfo[]>
850
+ */
815
851
  getConnectedVideoinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
816
852
  getConnectedDevices(type: MediaDeviceKind): Promise<MediaDeviceInfo[] | undefined>;
817
853
  openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "larksr_websdk",
3
- "version": "3.2.317",
3
+ "version": "3.2.320",
4
4
  "description": "Larksr websdk. Easy to build a cloud render client for larksr system or ue4 pixelstreaming.docs: https://pingxingyun.github.io/webclient_sdk/",
5
5
  "keywords": [
6
6
  "pingxingyun",
package/types/api.d.ts CHANGED
@@ -35,6 +35,9 @@ export interface GetTaskResult {
35
35
  wm: number;
36
36
  textInputEventPrompt: number;
37
37
  audioInput: number;
38
+ audioInputAutoStart: number;
39
+ videoInput: number;
40
+ videoInputAutoStart: number;
38
41
  }
39
42
  export interface StartAppInfo {
40
43
  appliId: string;
@@ -172,7 +172,7 @@ export interface IAppliParams {
172
172
  /**
173
173
  * 优先使用的解码器
174
174
  */
175
- perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
175
+ preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
176
176
  /**
177
177
  * 触摸操作对应的操作方式,触摸屏还是鼠标
178
178
  */
@@ -193,6 +193,8 @@ export interface IAppliParams {
193
193
  textInputEventPrompt: boolean;
194
194
  audioInput: boolean;
195
195
  audioInputAutoStart: boolean;
196
+ videoInput: boolean;
197
+ videoInputAutoStart: boolean;
196
198
  }
197
199
  export declare enum AppliType {
198
200
  DESKTOP = 1,
@@ -243,7 +245,7 @@ export declare class AppliParams implements IAppliParams {
243
245
  mobileVirtualJoystick: boolean;
244
246
  mouseZoomDirection: number;
245
247
  showPlayerList: boolean;
246
- perferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
248
+ preferDecoder: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
247
249
  touchOperateMode: 'touchScreen' | 'mouse';
248
250
  appliId: string;
249
251
  syncLocalToCloudClipboard: boolean;
@@ -255,6 +257,8 @@ export declare class AppliParams implements IAppliParams {
255
257
  textInputEventPrompt: boolean;
256
258
  audioInput: boolean;
257
259
  audioInputAutoStart: boolean;
260
+ videoInput: boolean;
261
+ videoInputAutoStart: boolean;
258
262
  static copyAndCreate(params?: IAppliParams): AppliParams;
259
263
  static setUpWithSDKConfig(params: IAppliParams, config: ILarkSRConfig): AppliParams;
260
264
  }
@@ -59,6 +59,8 @@ export default class Application extends EventBase<APP_EVENT_TYPE, AppEvent> {
59
59
  private _state;
60
60
  get audioDeviceId(): string | undefined;
61
61
  get audioTrack(): MediaStreamTrack | undefined;
62
+ get videoDeviceId(): string | undefined;
63
+ get videoTrack(): MediaStreamTrack | undefined;
62
64
  private retryTime;
63
65
  private larksr;
64
66
  get voiceId(): number;
@@ -98,6 +98,8 @@ export default class PeerConnection extends EventBase<WEBRTC_EVENT_TYPE, WebRTCE
98
98
  private videoStream;
99
99
  get audioDeviceId(): string | undefined;
100
100
  get audioTrack(): MediaStreamTrack | undefined;
101
+ get videoDeviceId(): string | undefined;
102
+ get videoTrack(): MediaStreamTrack | undefined;
101
103
  private localAudioTrackBinding;
102
104
  private localVideoTrackBinding;
103
105
  private localShareTrackBinding;
package/types/larksr.d.ts CHANGED
@@ -277,7 +277,7 @@ interface ILarkSRConfig {
277
277
  /**
278
278
  * 可选项,优选选择的视频编码格式
279
279
  */
280
- perferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'av1x';
280
+ preferDecoder?: 'auto' | 'vp8' | 'vp9' | 'h264' | 'h265' | 'hevc' | 'av1x';
281
281
  /**
282
282
  * 可选项,视频在容器中的缩放模式
283
283
  *
@@ -324,9 +324,15 @@ interface ILarkSRConfig {
324
324
  /**
325
325
  * 当启用音频输入功能,是否自动连入音频设备。
326
326
  * 默认关闭。
327
- * 需要注意默认打开的时系统中默认的音频设备。
327
+ * 需要注意默认打开的是系统中默认的音频设备。
328
328
  */
329
329
  audioInputAutoStart?: boolean;
330
+ /**
331
+ * 当启用视频输入功能,是否自动连入视频设备。
332
+ * 默认关闭。
333
+ * 需要注意默认打开的是系统中默认的视频设备。
334
+ */
335
+ videoInputAutoStart?: boolean;
330
336
  }
331
337
  declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
332
338
  /**
@@ -462,6 +468,14 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
462
468
  * 当前打开音频的track对象,未打开状态为空
463
469
  */
464
470
  get audioTrack(): MediaStreamTrack | undefined;
471
+ /**
472
+ * 当前打开视频设备 ID,如果打开时没指定特设备id为空
473
+ */
474
+ get videoDeviceId(): string | undefined;
475
+ /**
476
+ * 当前打开视频track对象,未打开状态为空
477
+ */
478
+ get videoTrack(): MediaStreamTrack | undefined;
465
479
  /**
466
480
  * LarkSR 客户端。所有操作和事件通过该类传递
467
481
  * @param config 本地配置,优先级最高
@@ -782,6 +796,11 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
782
796
  * @returns
783
797
  */
784
798
  setAudioEnable(enable: boolean): void | undefined;
799
+ /**
800
+ * 设置当前已开启的视频track是否启用状态
801
+ * @param enable 是否启用
802
+ * @returns
803
+ */
785
804
  setVideoEnable(enable: boolean): void | undefined;
786
805
  setShareEnable(enable: boolean): void | undefined;
787
806
  /**
@@ -794,24 +813,41 @@ declare class LarkSR extends EventBase<LarkSRClientEvent, LarkSREvent> {
794
813
  /**
795
814
  * 打开一个音频设备,要注意浏览器限制在 https 或者 localhost 下才能打开音频
796
815
  * @param deviceId 音频设备id,如果不传将打开默认设备。@see getConnectedAudioinputDevices
797
- * @returns
816
+ * @returns Promise
798
817
  */
799
818
  openAudio(deviceId?: string): Promise<{
800
819
  streams: MediaStream;
801
820
  rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
802
821
  } | undefined>;
822
+ /**
823
+ * 打开一个视频设备,要注意浏览器限制在 https 或者 localhost 下才能打开视频
824
+ * @param audio boolean 是否同时开启音频
825
+ * @param cameraId 视频设备id,如果不传将打开默认设备。@see getConnectedVideoinputDevices
826
+ * @returns Promise
827
+ */
803
828
  openVideo(audio?: boolean, cameraId?: string): Promise<{
804
829
  streams: MediaStream;
805
830
  rtcRtpSenders: import("./lark/peer_connection").RTCMediaTrackBinding[];
806
831
  } | undefined>;
832
+ /**
833
+ * 打开默认媒体设备,要注意浏览器限制在 https 或者 localhost 下
834
+ * 如果需要指定特殊的媒体设备请单独使用 @see openAudio @see openVideo
835
+ * @param video 是否包含视频
836
+ * @param audio 是否包含音频
837
+ * @returns Promise
838
+ */
807
839
  openDefaultMedia(video?: boolean, audio?: boolean): Promise<void | undefined>;
808
840
  openShareMediaDevice(): Promise<void | undefined>;
809
841
  /**
810
842
  * 返回已连接的音频设备列表,设备列表中的设备的 deviceId 可用来打开某个音频设备
811
- * @returns
843
+ * @returns Promise<MediaDeviceInfo[]>
812
844
  */
813
845
  getConnectedAudioinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
814
846
  getConnectedAudioOutputDevices(): Promise<MediaDeviceInfo[] | undefined>;
847
+ /**
848
+ * 返回已连接的视频设备
849
+ * @returns Promise<MediaDeviceInfo[]>
850
+ */
815
851
  getConnectedVideoinputDevices(): Promise<MediaDeviceInfo[] | undefined>;
816
852
  getConnectedDevices(type: MediaDeviceKind): Promise<MediaDeviceInfo[] | undefined>;
817
853
  openAudioDevice(deviceId: string, kind?: "audioinput" | "audiooutput"): Promise<{