yjz-web-sdk 1.0.10 → 1.0.11-beta.2

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 (62) hide show
  1. package/lib/components/RemotePlayer/index.vue.d.ts +1 -73
  2. package/lib/composables/useCursorStyle.d.ts +1 -1
  3. package/lib/composables/useKeyboardControl.d.ts +5 -1
  4. package/lib/composables/useMouseTouchControl.d.ts +5 -4
  5. package/lib/composables/useRemoteVideo.d.ts +8 -25
  6. package/lib/composables/useResizeObserver.d.ts +1 -1
  7. package/lib/core/data/WebRtcError.d.ts +1 -2
  8. package/lib/core/data/WebrtcDataType.d.ts +1 -11
  9. package/lib/core/groupctrl/SdkController.d.ts +2 -2
  10. package/lib/core/rtc/WebRTCClient.d.ts +2 -5
  11. package/lib/core/rtc/WebRTCConfig.d.ts +1 -1
  12. package/lib/core/rtc/WebRtcNegotiate.d.ts +2 -2
  13. package/lib/core/signal/SignalingClient.d.ts +1 -1
  14. package/lib/core/util/KeyCodeUtil.d.ts +6 -0
  15. package/lib/core/util/TurnTestUtil.d.ts +2 -2
  16. package/lib/yjz-web-sdk.js +728 -1307
  17. package/package.json +5 -16
  18. package/lib/components/RemotePlayer/type.d.ts +0 -9
  19. package/lib/core/util/MapCache.d.ts +0 -20
  20. package/lib/render/Canvas2DRenderer.d.ts +0 -10
  21. package/lib/render/WebGLRenderer.d.ts +0 -16
  22. package/lib/render/WebGPURenderer.d.ts +0 -18
  23. package/lib/types/index.d.ts +0 -13
  24. package/lib/util/WasmUtil.d.ts +0 -17
  25. package/lib/worker/worker.d.ts +0 -1
  26. package/src/assets/icon/circle.svg +0 -1
  27. package/src/assets/icon/triangle.svg +0 -1
  28. package/src/assets/wasm/h264-atomic.wasm +0 -0
  29. package/src/assets/wasm/h264-simd.wasm +0 -0
  30. package/src/components/RemotePlayer/index.vue +0 -170
  31. package/src/components/RemotePlayer/type.ts +0 -11
  32. package/src/composables/useCursorStyle.ts +0 -15
  33. package/src/composables/useKeyboardControl.ts +0 -32
  34. package/src/composables/useMouseTouchControl.ts +0 -158
  35. package/src/composables/useRemoteVideo.ts +0 -248
  36. package/src/composables/useResizeObserver.ts +0 -27
  37. package/src/core/WebRTCSdk.ts +0 -561
  38. package/src/core/data/MessageType.ts +0 -70
  39. package/src/core/data/TurnType.ts +0 -25
  40. package/src/core/data/WebRtcError.ts +0 -93
  41. package/src/core/data/WebrtcDataType.ts +0 -354
  42. package/src/core/groupctrl/GroupCtrlSocketManager.ts +0 -94
  43. package/src/core/groupctrl/SdkController.ts +0 -96
  44. package/src/core/rtc/WebRTCClient.ts +0 -862
  45. package/src/core/rtc/WebRTCConfig.ts +0 -86
  46. package/src/core/rtc/WebRtcNegotiate.ts +0 -164
  47. package/src/core/signal/SignalingClient.ts +0 -221
  48. package/src/core/util/FileTypeUtils.ts +0 -75
  49. package/src/core/util/KeyCodeUtil.ts +0 -162
  50. package/src/core/util/Logger.ts +0 -83
  51. package/src/core/util/MapCache.ts +0 -135
  52. package/src/core/util/ScreenControlUtil.ts +0 -174
  53. package/src/core/util/TurnTestUtil.ts +0 -123
  54. package/src/env.d.ts +0 -30
  55. package/src/index.ts +0 -61
  56. package/src/render/Canvas2DRenderer.ts +0 -38
  57. package/src/render/WebGLRenderer.ts +0 -150
  58. package/src/render/WebGPURenderer.ts +0 -194
  59. package/src/types/index.ts +0 -15
  60. package/src/types/webgpu.d.ts +0 -1158
  61. package/src/util/WasmUtil.ts +0 -291
  62. package/src/worker/worker.ts +0 -292
@@ -1,74 +1,2 @@
1
- import type { Dimension } from "./type";
2
- interface Props {
3
- streamAngle?: number;
4
- videoAngle?: number;
5
- cursorType?: number;
6
- cloudDeviceSize?: Dimension;
7
- disabled?: boolean;
8
- bgColor?: string;
9
- isGroup?: boolean;
10
- }
11
- declare const _default: import("vue").DefineComponent<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
12
- streamAngle: number;
13
- videoAngle: number;
14
- cursorType: number;
15
- cloudDeviceSize: () => {
16
- width: number;
17
- height: number;
18
- };
19
- disabled: boolean;
20
- bgColor: string;
21
- isGroup: boolean;
22
- }>>, {
23
- startDecode: (arrayBuffer: ArrayBuffer) => void;
24
- stopPlay: () => void;
25
- remoteVideoElement: import("vue").Ref<HTMLCanvasElement, HTMLCanvasElement>;
26
- startPlay: (track: MediaStreamTrack) => void;
27
- }, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
28
- loadedSuccess: (...args: any[]) => void;
29
- loadedFailure: (...args: any[]) => void;
30
- channelEvent: (...args: any[]) => void;
31
- groupControlEvent: (...args: any[]) => void;
32
- }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
33
- streamAngle: number;
34
- videoAngle: number;
35
- cursorType: number;
36
- cloudDeviceSize: () => {
37
- width: number;
38
- height: number;
39
- };
40
- disabled: boolean;
41
- bgColor: string;
42
- isGroup: boolean;
43
- }>>> & Readonly<{
44
- onLoadedSuccess?: (...args: any[]) => any;
45
- onLoadedFailure?: (...args: any[]) => any;
46
- onChannelEvent?: (...args: any[]) => any;
47
- onGroupControlEvent?: (...args: any[]) => any;
48
- }>, {
49
- cloudDeviceSize: Dimension;
50
- streamAngle: number;
51
- videoAngle: number;
52
- isGroup: boolean;
53
- cursorType: number;
54
- disabled: boolean;
55
- bgColor: string;
56
- }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
1
+ declare const _default: any;
57
2
  export default _default;
58
- type __VLS_NonUndefinedable<T> = T extends undefined ? never : T;
59
- type __VLS_TypePropsToRuntimeProps<T> = {
60
- [K in keyof T]-?: {} extends Pick<T, K> ? {
61
- type: import('vue').PropType<__VLS_NonUndefinedable<T[K]>>;
62
- } : {
63
- type: import('vue').PropType<T[K]>;
64
- required: true;
65
- };
66
- };
67
- type __VLS_WithDefaults<P, D> = {
68
- [K in keyof Pick<P, keyof P>]: K extends keyof D ? __VLS_Prettify<P[K] & {
69
- default: D[K];
70
- }> : P[K];
71
- };
72
- type __VLS_Prettify<T> = {
73
- [K in keyof T]: T[K];
74
- } & {};
@@ -1,2 +1,2 @@
1
1
  import type { Ref } from 'vue';
2
- export default function useCursorStyle(cursorType: Ref<number>): import("vue").ComputedRef<"circle-cursor" | "triangle-cursor" | "default-cursor">;
2
+ export default function useCursorStyle(cursorType: Ref<number>): any;
@@ -1,6 +1,10 @@
1
1
  import { ChannelDataType } from "../core/data/WebrtcDataType";
2
2
  import { type Ref } from "vue";
3
- export default function useKeyboardControl(disabled: Ref<boolean>, emit: (event: 'channelEvent', payload: ChannelDataType, data: any) => void): {
3
+ export default function useKeyboardControl(imeInput: Ref<HTMLTextAreaElement | null>, disabled: Ref<boolean>, emit: (event: 'channelEvent', payload: ChannelDataType, data: any) => void): {
4
4
  startListening: () => void;
5
5
  stopListening: () => void;
6
+ onCompositionStart: (_e: CompositionEvent) => void;
7
+ onCompositionEnd: (e: CompositionEvent) => void;
8
+ onInput: (e: InputEvent) => void;
9
+ onKeyDown: (event: KeyboardEvent) => void;
6
10
  };
@@ -1,21 +1,22 @@
1
1
  import type { Ref } from 'vue';
2
2
  import { ChannelDataType } from "../core/data/WebrtcDataType";
3
- import type { Dimension } from "../components/RemotePlayer/type";
3
+ import type { Dimension } from "../components/RemotePlayer/index.ts";
4
4
  interface MouseTouchControlOptions {
5
- remoteVideoElement: Ref<HTMLCanvasElement | null>;
5
+ remoteVideoElement: Ref<HTMLVideoElement | null>;
6
6
  cloudDeviceSize: Ref<Dimension>;
7
7
  streamAngle: Ref<number>;
8
8
  videoAngle: Ref<number>;
9
9
  widthRadio: Ref<number>;
10
10
  isGroup: Ref<boolean>;
11
+ isMove: Ref<boolean>;
11
12
  emit: (event: 'channelEvent', payload: ChannelDataType, data: any) => void;
12
13
  }
13
14
  export default function useMouseTouchControl(options: MouseTouchControlOptions): {
14
- isPointerDown: Ref<boolean, boolean>;
15
+ pointers: any;
15
16
  handleMouseDown: (event: PointerEvent) => void;
16
17
  handleMouseMove: (event: PointerEvent) => void;
17
- handleMouseEnter: (event: PointerEvent) => void;
18
18
  handleMouseUp: (event: PointerEvent) => void;
19
+ handleMouseEnter: (event: PointerEvent) => void;
19
20
  handleMouseLeave: (event: PointerEvent) => void;
20
21
  handleWheel: (e: WheelEvent) => void;
21
22
  };
@@ -1,29 +1,12 @@
1
1
  import type { Ref } from 'vue';
2
- import { Dimension } from '../components/RemotePlayer/type';
3
- export default function useRemoteVideo(videoContainer: Ref<HTMLElement | null>, remoteVideoElement: Ref<HTMLCanvasElement | null>, audioElement: Ref<HTMLAudioElement | null>, videoAngle: Ref<number>, emit: (event: 'loadedSuccess' | 'loadedFailure', reason?: string) => void): {
4
- videoSize: import("vue").ComputedRef<{
5
- width: number;
6
- height: number;
7
- }>;
8
- remoteVideo: Ref<{
9
- width?: number;
10
- height?: number;
11
- }, Partial<Dimension> | {
12
- width?: number;
13
- height?: number;
14
- }>;
15
- dimensions: Ref<{
16
- width: number;
17
- height: number;
18
- }, Dimension | {
19
- width: number;
20
- height: number;
21
- }>;
22
- widthRadio: Ref<number, number>;
23
- heightRadio: Ref<number, number>;
24
- screenStatus: Ref<boolean, boolean>;
2
+ export default function useRemoteVideo(videoContainer: Ref<HTMLElement | null>, remoteVideoElement: Ref<HTMLVideoElement | null>, videoAngle: Ref<number>, emit: (event: 'loadedSuccess') => void): {
3
+ videoSize: any;
4
+ remoteVideo: any;
5
+ dimensions: any;
6
+ widthRadio: any;
7
+ heightRadio: any;
8
+ screenStatus: any;
25
9
  initVideoContainer: () => void;
26
- startDecode: (arrayBuffer: ArrayBuffer) => void;
27
- stopPlay: () => void;
28
10
  startPlay: (track: MediaStreamTrack) => void;
11
+ stopPlay: () => void;
29
12
  };
@@ -1,3 +1,3 @@
1
1
  import type { Ref } from 'vue';
2
- import type { Dimension } from "../components/RemotePlayer/type";
2
+ import type { Dimension } from "../components/RemotePlayer/index.ts";
3
3
  export default function useResizeObserver(target: Ref<HTMLElement | null>, dimension: Ref<Dimension>): void;
@@ -52,6 +52,5 @@ export declare enum EmitType {
52
52
  cloudClipData = "cloudClipData",
53
53
  screenshot = "screenshot",
54
54
  reconnect = "reconnect",
55
- groupError = "groupError",
56
- arrayBuffer = "arrayBuffer"
55
+ groupError = "groupError"
57
56
  }
@@ -11,8 +11,7 @@ export declare enum ChannelDataType {
11
11
  ActionCommandEvent = "ActionCommandEvent",
12
12
  ActionUpdateCloudStatus = "ActionUpdateCloudStatus",
13
13
  ActionGesture = "ActionGesture",
14
- ActionTrack = "ActionTrack",
15
- RequestKeyFrame = "RequestKeyFrame"
14
+ ActionTrack = "ActionTrack"
16
15
  }
17
16
  export declare enum ActionCommandEventValue {
18
17
  ENABLE = "ENABLE",
@@ -175,7 +174,6 @@ export declare class ChannelData {
175
174
  static clarity(data: any): ChannelData;
176
175
  static switchAudio(data: any): ChannelData;
177
176
  static changeSender(data: any): ChannelData;
178
- static requestKeyFrame(data: any): ChannelData;
179
177
  }
180
178
  export interface RTCStatsReportExtended extends RTCStatsReport {
181
179
  get(id: string): RTCStats | undefined;
@@ -210,11 +208,3 @@ export interface ScreenShotData {
210
208
  roomId: string;
211
209
  base64: string;
212
210
  }
213
- export declare class BitReader {
214
- private data;
215
- private byteOffset;
216
- private bitOffset;
217
- constructor(data: Uint8Array);
218
- readBits(count: number): number;
219
- readUEG(): number;
220
- }
@@ -1,7 +1,7 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import type { WebRTCConfigOptions } from '../rtc/WebRTCConfig';
2
+ import type { WebRTCConfigOptions } from '../rtc/WebRTCConfig.ts';
3
3
  import { WebRTCSdk } from '../WebRTCSdk';
4
- import type { ChannelDataType } from '../data/WebrtcDataType';
4
+ import type { ChannelDataType } from '../data/WebrtcDataType.ts';
5
5
  import type { ConnectorType } from '../data/MessageType';
6
6
  export declare class SdkController extends EventEmitter {
7
7
  private readonly sdk;
@@ -1,6 +1,6 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import type { WebRTCConfig } from "./WebRTCConfig";
3
- import { ChannelDataType } from "../data/WebrtcDataType";
2
+ import type { WebRTCConfig } from "./WebRTCConfig.ts";
3
+ import { ChannelDataType } from "../data/WebrtcDataType.ts";
4
4
  export declare class WebRTCClient extends EventEmitter {
5
5
  private readonly config;
6
6
  private peerConnection;
@@ -9,7 +9,6 @@ export declare class WebRTCClient extends EventEmitter {
9
9
  private isPushingStream;
10
10
  private isPushingLocalStream;
11
11
  private dataChannel;
12
- private videoDataChannel;
13
12
  private statsTimer;
14
13
  private lastReportTime;
15
14
  private lastBytesReceived;
@@ -24,7 +23,6 @@ export declare class WebRTCClient extends EventEmitter {
24
23
  private rafId;
25
24
  private currentMedia;
26
25
  private fileImage?;
27
- private isFirst;
28
26
  constructor(config: WebRTCConfig);
29
27
  startPush(useBackCamera?: boolean): Promise<void>;
30
28
  handleOffer(offerSdp: string): void;
@@ -42,7 +40,6 @@ export declare class WebRTCClient extends EventEmitter {
42
40
  stopPush(): void;
43
41
  private resetPeerConnection;
44
42
  private configDataChannel;
45
- private handleVideoChannelMessage;
46
43
  private handleDataChannelMessage;
47
44
  private checkStats;
48
45
  private processStatsOptimized;
@@ -1,5 +1,5 @@
1
1
  import { ConnectorType } from '../data/MessageType';
2
- import { LogLevel } from "../util/Logger";
2
+ import { LogLevel } from "../util/Logger.ts";
3
3
  export interface WebRTCConfigOptions {
4
4
  signalServerUrl: string;
5
5
  myId?: string;
@@ -1,5 +1,5 @@
1
- import { type WebRtcError } from "../data/WebRtcError";
2
- import { WebRTCConfig } from "./WebRTCConfig";
1
+ import { type WebRtcError } from "../data/WebRtcError.ts";
2
+ import { WebRTCConfig } from "./WebRTCConfig.ts";
3
3
  export declare const setRemoteDescriptionWithHandleOffer: (peerConnection: RTCPeerConnection, sdp: string, sendAnswer?: (sdp: string) => void, onError?: (err: WebRtcError) => void) => void;
4
4
  export declare const createPeerConnection: (config: WebRTCConfig) => RTCPeerConnection;
5
5
  export declare const configPeerConnection: (peerConnection: RTCPeerConnection, onICEMessage: (candidate: string) => void, onTrack?: (track: MediaStreamTrack) => void, onConnectState?: (state: RTCIceConnectionState) => void, onError?: (error: WebRtcError) => void) => void;
@@ -1,5 +1,5 @@
1
1
  import { EventEmitter } from 'eventemitter3';
2
- import type { WebRTCConfig } from '../rtc/WebRTCConfig';
2
+ import type { WebRTCConfig } from '../rtc/WebRTCConfig.ts';
3
3
  import { ConnectorType } from '../data/MessageType';
4
4
  export declare class SignalingClient extends EventEmitter {
5
5
  private config;
@@ -14,3 +14,9 @@ export interface KeyEventData {
14
14
  * @returns 包含 androidKeyCode 和 metaState 的对象
15
15
  */
16
16
  export declare const getKeyEventData: (event: KeyboardEvent) => KeyEventData;
17
+ /**
18
+ * 判断当前按键是否属于功能键
19
+ * @param event - 浏览器 KeyboardEvent
20
+ * @returns true 表示是功能键
21
+ */
22
+ export declare const isFunctionKey: (event: KeyboardEvent) => boolean;
@@ -1,5 +1,5 @@
1
- import type { TurnSelectionResult, TurnServerConfig, TurnTestResult, TurnTestSummary } from '../data/TurnType';
2
- import type { WebRTCConfigOptions } from '../rtc/WebRTCConfig';
1
+ import type { TurnSelectionResult, TurnServerConfig, TurnTestResult, TurnTestSummary } from '../data/TurnType.ts';
2
+ import type { WebRTCConfigOptions } from '../rtc/WebRTCConfig.ts';
3
3
  export declare const testTurnServer: (turnConfig: TurnServerConfig, timeoutMs?: number) => Promise<TurnTestResult>;
4
4
  export declare const testMultipleTurnServers: (servers: string[], timeoutMs?: number) => Promise<TurnTestSummary>;
5
5
  export declare const areTurnListsEmpty: (options: WebRTCConfigOptions) => boolean;