yjz-web-sdk 1.0.8-beta.9 → 1.0.9-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.
- package/lib/components/RemotePlayer/index.vue.d.ts +71 -1
- package/lib/components/RemotePlayer/type.d.ts +25 -0
- package/lib/composables/useCursorStyle.d.ts +1 -1
- package/lib/composables/useKeyboardControl.d.ts +1 -1
- package/lib/composables/useMouseTouchControl.d.ts +5 -4
- package/lib/composables/useRemoteVideo.d.ts +25 -8
- package/lib/composables/useResizeObserver.d.ts +1 -1
- package/lib/core/WebRTCSdk.d.ts +15 -11
- package/lib/core/data/MessageType.d.ts +36 -2
- package/lib/core/data/WebRtcError.d.ts +3 -1
- package/lib/core/data/WebrtcDataType.d.ts +56 -40
- package/lib/core/groupctrl/GroupCtrlSocketManager.d.ts +18 -0
- package/lib/core/groupctrl/SdkController.d.ts +25 -8
- package/lib/core/rtc/WebRTCClient.d.ts +12 -5
- package/lib/core/rtc/WebRTCConfig.d.ts +18 -8
- package/lib/core/rtc/WebRtcNegotiate.d.ts +2 -2
- package/lib/core/signal/SignalingClient.d.ts +8 -8
- package/lib/core/util/FileTypeUtils.d.ts +1 -0
- package/lib/core/util/Logger.d.ts +20 -0
- package/lib/core/util/MapCache.d.ts +20 -0
- package/lib/core/util/TurnTestUtil.d.ts +2 -2
- package/lib/index.d.ts +3 -2
- package/lib/render/Canvas2DRenderer.d.ts +10 -0
- package/lib/render/WebGLRenderer.d.ts +16 -0
- package/lib/render/WebGPURenderer.d.ts +18 -0
- package/lib/util/WasmUtil.d.ts +16 -0
- package/lib/worker/myWorker.d.ts +1 -0
- package/lib/worker/worker.d.ts +1 -0
- package/lib/yjz-web-sdk.js +13803 -894
- package/lib/yjz-web-sdk.umd.cjs +937 -93
- package/package.json +13 -3
- package/lib/core/groupctrl/GroupControllerManager.d.ts +0 -29
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare enum LogLevel {
|
|
2
|
+
DEBUG = 10,
|
|
3
|
+
INFO = 20,
|
|
4
|
+
WARN = 30,
|
|
5
|
+
ERROR = 40,
|
|
6
|
+
OFF = 100
|
|
7
|
+
}
|
|
8
|
+
export declare function setLogLevel(level: LogLevel): void;
|
|
9
|
+
export declare function enableLog(enable: boolean): void;
|
|
10
|
+
export declare function setNamespace(ns: string): void;
|
|
11
|
+
declare class LoggerCore {
|
|
12
|
+
private canLog;
|
|
13
|
+
private log;
|
|
14
|
+
debug(...args: any[]): void;
|
|
15
|
+
info(...args: any[]): void;
|
|
16
|
+
warn(...args: any[]): void;
|
|
17
|
+
error(...args: any[]): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const Logger: LoggerCore;
|
|
20
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export declare class MapCache {
|
|
2
|
+
private key;
|
|
3
|
+
private maxSize;
|
|
4
|
+
private defaultExpire;
|
|
5
|
+
constructor(key: string, maxSize?: number, expireMs?: number);
|
|
6
|
+
/** 从 localStorage 读取 Map(自动清理过期的 item) */
|
|
7
|
+
getMap(): Map<string, any>;
|
|
8
|
+
/** 保存 Map(每个值都有独立的 timestamp/expire) */
|
|
9
|
+
private saveMap;
|
|
10
|
+
/** 设置值(支持单项自定义过期时间) */
|
|
11
|
+
set(key: string, value: any, expireMs?: number): void;
|
|
12
|
+
/** 获取值(单项过期会自动清除) */
|
|
13
|
+
get(key: string): any;
|
|
14
|
+
/** 检查是否存在且未过期 */
|
|
15
|
+
has(key: string): boolean;
|
|
16
|
+
/** 删除 */
|
|
17
|
+
delete(key: string): void;
|
|
18
|
+
/** 清空 */
|
|
19
|
+
clear(): void;
|
|
20
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TurnSelectionResult, TurnServerConfig, TurnTestResult, TurnTestSummary } from
|
|
2
|
-
import type { WebRTCConfigOptions } from
|
|
1
|
+
import type { TurnSelectionResult, TurnServerConfig, TurnTestResult, TurnTestSummary } from '../data/TurnType';
|
|
2
|
+
import type { WebRTCConfigOptions } from '../rtc/WebRTCConfig';
|
|
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;
|
package/lib/index.d.ts
CHANGED
|
@@ -5,7 +5,8 @@ import { transformCoordinate, valueToPercentage } from "./core/util/ScreenContro
|
|
|
5
5
|
import { ActionType, ChannelDataType, ContainerDirection, InputData, KeyEventData, TouchData, WheelData, GestureData, type ActionCommand, ActionCommandType, ActionCommandEventType, ActionCommandEventValue, TrackEventData, ClarityData } from "./core/data/WebrtcDataType";
|
|
6
6
|
import { type TurnServerConfig, type TurnTestResult, type TurnTestSummary } from "./core/data/TurnType";
|
|
7
7
|
import type { WebRTCConfigOptions } from './core/rtc/WebRTCConfig';
|
|
8
|
-
import { GroupControllerManager } from "./core/groupctrl/GroupControllerManager";
|
|
9
8
|
import { EmitType, type CameraError, type WebRtcError } from "./core/data/WebRtcError";
|
|
10
9
|
import RemotePlayer from './components/RemotePlayer/index.vue';
|
|
11
|
-
|
|
10
|
+
import { ConnectorType } from './core/data/MessageType';
|
|
11
|
+
import { GroupCtrlSocketManager } from './core/groupctrl/GroupCtrlSocketManager';
|
|
12
|
+
export { WebRTCSdk, getKeyEventData, transformCoordinate, valueToPercentage, ActionType, ChannelDataType, InputData, KeyEventData, TouchData, ContainerDirection, EmitType, WheelData, GestureData, ClarityData, type ActionCommand, ActionCommandType, type WebRTCConfigOptions, ActionCommandEventType, ActionCommandEventValue, RemotePlayer, TrackEventData, type TurnServerConfig, type TurnTestResult, type TurnTestSummary, testMultipleTurnServers, type CameraError, type WebRtcError, ConnectorType, GroupCtrlSocketManager };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare class WebGLRenderer {
|
|
2
|
+
private canvas;
|
|
3
|
+
private ctx;
|
|
4
|
+
private program;
|
|
5
|
+
private texture;
|
|
6
|
+
private vertexBuffer;
|
|
7
|
+
static vertexShaderSource: string;
|
|
8
|
+
static fragmentShaderSource: string;
|
|
9
|
+
constructor(type: "webgl" | "webgl2", canvas: HTMLCanvasElement);
|
|
10
|
+
private createProgram;
|
|
11
|
+
render(frame: VideoFrame): void;
|
|
12
|
+
/** 清空画布,但不销毁资源 */
|
|
13
|
+
clear(): void;
|
|
14
|
+
/** 销毁 WebGLRenderer,释放所有资源 */
|
|
15
|
+
destroy(): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare class WebGPURenderer {
|
|
2
|
+
private canvas;
|
|
3
|
+
private ctx;
|
|
4
|
+
private started;
|
|
5
|
+
private format;
|
|
6
|
+
private device;
|
|
7
|
+
private pipeline;
|
|
8
|
+
private sampler;
|
|
9
|
+
static vertexShaderSource: string;
|
|
10
|
+
static fragmentShaderSource: string;
|
|
11
|
+
constructor(canvas: HTMLCanvasElement);
|
|
12
|
+
start(): Promise<void>;
|
|
13
|
+
render(frame: VideoFrame | HTMLVideoElement | HTMLCanvasElement | HTMLImageElement): Promise<void>;
|
|
14
|
+
/** 清空画布 */
|
|
15
|
+
clear(): Promise<void>;
|
|
16
|
+
/** 销毁 WebGPURenderer,释放所有 GPU 资源 */
|
|
17
|
+
destroy(): void;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AVCodecID } from "@libmedia/avutil";
|
|
2
|
+
export declare function getWasm(type: 'decoder' | 'encoder', codecId?: AVCodecID): string;
|
|
3
|
+
export declare enum VideoCodecType {
|
|
4
|
+
H264 = "h264",
|
|
5
|
+
H265 = "h265",
|
|
6
|
+
VP8 = "vp8",
|
|
7
|
+
VP9 = "vp9",
|
|
8
|
+
AV1 = "av1"
|
|
9
|
+
}
|
|
10
|
+
export declare function isDecoderSupported(codec: VideoCodecType): Promise<boolean>;
|
|
11
|
+
export declare function isEncoderSupported(codec: VideoCodecType): Promise<boolean>;
|
|
12
|
+
export declare const isMobileDevice: () => boolean;
|
|
13
|
+
export declare const isWebGPUSupported: () => boolean;
|
|
14
|
+
export declare const isWebGLSupported: (canvas?: HTMLCanvasElement) => boolean;
|
|
15
|
+
export declare const isWebGL2Supported: (canvas?: HTMLCanvasElement) => boolean;
|
|
16
|
+
export declare const isCanvas2DSupported: (canvas?: HTMLCanvasElement) => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|