yjz-web-sdk 1.0.6 → 1.0.7-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/composables/useMouseTouchControl.d.ts +0 -4
- package/lib/core/WebRTCSdk.d.ts +1 -0
- package/lib/core/data/MessageType.d.ts +5 -2
- package/lib/core/data/WebRtcError.d.ts +3 -1
- package/lib/core/data/WebrtcDataType.d.ts +13 -1
- package/lib/core/groupctrl/GroupControllerManager.d.ts +1 -0
- package/lib/core/groupctrl/SdkController.d.ts +1 -0
- package/lib/core/rtc/WebRTCConfig.d.ts +4 -0
- package/lib/core/signal/SignalingClient.d.ts +1 -1
- package/lib/index.d.ts +2 -2
- package/lib/yjz-web-sdk.js +120 -127
- package/lib/yjz-web-sdk.umd.cjs +28 -29
- package/package.json +1 -1
- package/lib/composables/useDeviceMode.d.ts +0 -6
|
@@ -2,7 +2,6 @@ import type { Ref } from 'vue';
|
|
|
2
2
|
import { ChannelDataType } from "../core/data/WebrtcDataType.ts";
|
|
3
3
|
import type { Dimension } from "../components/RemotePlayer/index.ts";
|
|
4
4
|
interface MouseTouchControlOptions {
|
|
5
|
-
isMobile: Ref<boolean>;
|
|
6
5
|
remoteVideoElement: Ref<HTMLVideoElement | null>;
|
|
7
6
|
cloudDeviceSize: Ref<Dimension>;
|
|
8
7
|
streamAngle: Ref<number>;
|
|
@@ -12,9 +11,6 @@ interface MouseTouchControlOptions {
|
|
|
12
11
|
}
|
|
13
12
|
export default function useMouseTouchControl(options: MouseTouchControlOptions): {
|
|
14
13
|
isPointerDown: any;
|
|
15
|
-
onTouchStart: (e: TouchEvent) => void;
|
|
16
|
-
onTouchMove: (e: TouchEvent) => void;
|
|
17
|
-
onTouchEnd: (e: TouchEvent) => void;
|
|
18
14
|
handleMouseDown: (event: PointerEvent) => void;
|
|
19
15
|
handleMouseMove: (event: PointerEvent) => void;
|
|
20
16
|
handleMouseEnter: (event: PointerEvent) => void;
|
package/lib/core/WebRTCSdk.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare class WebRTCSdk extends EventEmitter {
|
|
|
11
11
|
constructor(options: WebRTCConfigOptions);
|
|
12
12
|
/** 开始连接 signal 服务 */
|
|
13
13
|
startConnection(): void;
|
|
14
|
+
switchControl(isControl: boolean): void;
|
|
14
15
|
/** 停止连接,并发送退出信令 */
|
|
15
16
|
stop(): void;
|
|
16
17
|
/** 开始推流:触发媒体采集与轨道添加 */
|
|
@@ -7,7 +7,9 @@ export declare enum MessageType {
|
|
|
7
7
|
NotAvailable = "NotAvailable",
|
|
8
8
|
Ping = "Ping",
|
|
9
9
|
Pong = "Pong",
|
|
10
|
-
SendScreenshot = "SendScreenshot"
|
|
10
|
+
SendScreenshot = "SendScreenshot",
|
|
11
|
+
KickOut = "KickOut",
|
|
12
|
+
Error = "Error"
|
|
11
13
|
}
|
|
12
14
|
export declare enum SendType {
|
|
13
15
|
SignIn = "SignIn",
|
|
@@ -17,7 +19,8 @@ export declare enum SendType {
|
|
|
17
19
|
IceCandidates = "IceCandidates",
|
|
18
20
|
Pong = "Pong",
|
|
19
21
|
Identity = "Web",
|
|
20
|
-
RequestScreenshot = "RequestScreenshot"
|
|
22
|
+
RequestScreenshot = "RequestScreenshot",
|
|
23
|
+
SwitchControl = "SwitchControl"
|
|
21
24
|
}
|
|
22
25
|
export declare enum IceConnectionState {
|
|
23
26
|
NEW = "new",
|
|
@@ -12,7 +12,9 @@ export declare enum FailCode {
|
|
|
12
12
|
CAMERA = 10011,
|
|
13
13
|
NOT_AVAILABLE = 10012,
|
|
14
14
|
DATACHANNEL_ERR = 10013,
|
|
15
|
-
STREAM_STATE = 10014
|
|
15
|
+
STREAM_STATE = 10014,
|
|
16
|
+
AUTH_FAILED = 10015,
|
|
17
|
+
KICK_OUT_ERR = 10016
|
|
16
18
|
}
|
|
17
19
|
export declare const FailInfoMap: Record<FailCode, {
|
|
18
20
|
type: string;
|
|
@@ -10,7 +10,8 @@ export declare enum ChannelDataType {
|
|
|
10
10
|
CloudClipData = "CloudClipData",
|
|
11
11
|
ActionCommandEvent = "ActionCommandEvent",
|
|
12
12
|
ActionUpdateCloudStatus = "ActionUpdateCloudStatus",
|
|
13
|
-
ActionGesture = "ActionGesture"
|
|
13
|
+
ActionGesture = "ActionGesture",
|
|
14
|
+
ActionTrack = "ActionTrack"
|
|
14
15
|
}
|
|
15
16
|
export declare enum ActionCommandEventValue {
|
|
16
17
|
ENABLE = "ENABLE",
|
|
@@ -93,6 +94,10 @@ export declare class WheelData {
|
|
|
93
94
|
axis: number;
|
|
94
95
|
constructor(axis: number);
|
|
95
96
|
}
|
|
97
|
+
export declare class TrackEventData {
|
|
98
|
+
visible: boolean;
|
|
99
|
+
constructor(visible: boolean);
|
|
100
|
+
}
|
|
96
101
|
/**
|
|
97
102
|
* KeyEventData - 键盘事件数据类,包含键码及修饰状态
|
|
98
103
|
*/
|
|
@@ -108,6 +113,10 @@ export declare class GestureData {
|
|
|
108
113
|
mode: number;
|
|
109
114
|
constructor(mode: number);
|
|
110
115
|
}
|
|
116
|
+
export declare class ClarityData {
|
|
117
|
+
level: number;
|
|
118
|
+
constructor(level: number);
|
|
119
|
+
}
|
|
111
120
|
export declare class ChannelData {
|
|
112
121
|
type: ChannelDataType;
|
|
113
122
|
data: string | null;
|
|
@@ -161,6 +170,7 @@ export declare class ChannelData {
|
|
|
161
170
|
*/
|
|
162
171
|
static clarity(data: any): ChannelData;
|
|
163
172
|
static switchAudio(data: any): ChannelData;
|
|
173
|
+
static changeSender(data: any): ChannelData;
|
|
164
174
|
}
|
|
165
175
|
export interface RTCStatsReportExtended extends RTCStatsReport {
|
|
166
176
|
get(id: string): RTCStats | undefined;
|
|
@@ -181,6 +191,8 @@ export interface CloudStatusPayload {
|
|
|
181
191
|
screenWidth: number;
|
|
182
192
|
screenHeight: number;
|
|
183
193
|
gestureMode: number;
|
|
194
|
+
clarityLevel: number;
|
|
195
|
+
isClarity: boolean;
|
|
184
196
|
}
|
|
185
197
|
export interface CloudPointer {
|
|
186
198
|
rect: DOMRect;
|
|
@@ -11,6 +11,7 @@ export declare class GroupControllerManager extends EventEmitter {
|
|
|
11
11
|
constructor(interval?: number, visibility?: VisibilityManager);
|
|
12
12
|
startControl(configMap: Map<string, WebRTCConfigOptions>): void;
|
|
13
13
|
switchToMain(newRoomId: string, oldRoomId: string): void;
|
|
14
|
+
switchControl(roomId: string, isControl: boolean): void;
|
|
14
15
|
/**
|
|
15
16
|
* 找到当前主控config, 设置为从控
|
|
16
17
|
*/
|
|
@@ -9,6 +9,7 @@ export declare class SdkController extends EventEmitter {
|
|
|
9
9
|
setIsControl(value: boolean): void;
|
|
10
10
|
start(): void;
|
|
11
11
|
stop(): void;
|
|
12
|
+
switchControl(isControl: boolean): void;
|
|
12
13
|
sendData(type: ChannelDataType, data: any): void;
|
|
13
14
|
sendControlData(key: number): void;
|
|
14
15
|
requestScreenshot(visible: boolean): void;
|
|
@@ -17,6 +17,8 @@ export interface WebRTCConfigOptions {
|
|
|
17
17
|
screenUrl?: string;
|
|
18
18
|
connectStatus?: number;
|
|
19
19
|
cloudName?: string;
|
|
20
|
+
token: string;
|
|
21
|
+
isGroup: boolean;
|
|
20
22
|
}
|
|
21
23
|
export declare class WebRTCConfig {
|
|
22
24
|
signalServerUrl: string;
|
|
@@ -33,5 +35,7 @@ export declare class WebRTCConfig {
|
|
|
33
35
|
screenshotWidth: number;
|
|
34
36
|
screenshotHeight: number;
|
|
35
37
|
screenshotQuality: number;
|
|
38
|
+
token: string;
|
|
39
|
+
isGroup: boolean;
|
|
36
40
|
constructor(options: WebRTCConfigOptions);
|
|
37
41
|
}
|
|
@@ -3,7 +3,6 @@ import type { WebRTCConfig } from "../rtc/WebRTCConfig.ts";
|
|
|
3
3
|
export declare class SignalingClient extends EventEmitter {
|
|
4
4
|
private config;
|
|
5
5
|
private webSocket;
|
|
6
|
-
private timeout;
|
|
7
6
|
constructor(config: WebRTCConfig);
|
|
8
7
|
/**
|
|
9
8
|
* 启动 WebSocket 连接,并注册各事件处理
|
|
@@ -19,6 +18,7 @@ export declare class SignalingClient extends EventEmitter {
|
|
|
19
18
|
*/
|
|
20
19
|
sendMessage(message: string): void;
|
|
21
20
|
sendSignInMessage(): void;
|
|
21
|
+
sendSwitchControlMessage(isCtrl: boolean): void;
|
|
22
22
|
/**
|
|
23
23
|
* 用于从控请求当前截屏
|
|
24
24
|
* @param visible 当前从控page控件是否可见
|
package/lib/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { WebRTCSdk } from './core/WebRTCSdk';
|
|
2
2
|
import { getKeyEventData } from "./core/util/KeyCodeUtil";
|
|
3
3
|
import { transformCoordinate, valueToPercentage } from "./core/util/ScreenControlUtil";
|
|
4
|
-
import { ActionType, ChannelDataType, ContainerDirection, InputData, KeyEventData, TouchData, WheelData, GestureData, type ActionCommand, ActionCommandType, ActionCommandEventType, ActionCommandEventValue } from "./core/data/WebrtcDataType";
|
|
4
|
+
import { ActionType, ChannelDataType, ContainerDirection, InputData, KeyEventData, TouchData, WheelData, GestureData, type ActionCommand, ActionCommandType, ActionCommandEventType, ActionCommandEventValue, TrackEventData, ClarityData } from "./core/data/WebrtcDataType";
|
|
5
5
|
import type { WebRTCConfigOptions } from './core/rtc/WebRTCConfig';
|
|
6
6
|
import { GroupControllerManager } from "./core/groupctrl/GroupControllerManager.ts";
|
|
7
7
|
import { EmitType } from "./core/data/WebRtcError";
|
|
8
8
|
import RemotePlayer from './components/RemotePlayer/index.vue';
|
|
9
|
-
export { WebRTCSdk, getKeyEventData, transformCoordinate, valueToPercentage, ActionType, ChannelDataType, InputData, KeyEventData, TouchData, ContainerDirection, EmitType, WheelData, GestureData, type ActionCommand, ActionCommandType, GroupControllerManager, type WebRTCConfigOptions, ActionCommandEventType, ActionCommandEventValue, RemotePlayer };
|
|
9
|
+
export { WebRTCSdk, getKeyEventData, transformCoordinate, valueToPercentage, ActionType, ChannelDataType, InputData, KeyEventData, TouchData, ContainerDirection, EmitType, WheelData, GestureData, ClarityData, type ActionCommand, ActionCommandType, GroupControllerManager, type WebRTCConfigOptions, ActionCommandEventType, ActionCommandEventValue, RemotePlayer, TrackEventData };
|