@realsee/live 0.3.0-alpha.2 → 0.4.0-alpha.1
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/dist/index.d.ts +4 -0
- package/dist/live/controller.d.ts +43 -0
- package/{lib → dist/live}/createLive.d.ts +6 -6
- package/dist/live/createLiveReact.d.ts +6 -0
- package/dist/realsee-live.cjs.development.js +52517 -0
- package/dist/realsee-live.cjs.development.js.map +1 -0
- package/dist/realsee-live.cjs.js +7 -0
- package/dist/realsee-live.cjs.production.js +2 -0
- package/dist/realsee-live.cjs.production.js.map +1 -0
- package/dist/realsee-live.esm.js +52506 -0
- package/dist/realsee-live.esm.js.map +1 -0
- package/dist/realsee-live.umd.development.js +52454 -0
- package/dist/realsee-live.umd.development.js.map +1 -0
- package/dist/realsee-live.umd.production.js +2 -0
- package/dist/realsee-live.umd.production.js.map +1 -0
- package/{lib/RTC → dist/rtc}/BrowserRTC.d.ts +29 -30
- package/{lib/RTC → dist/rtc}/BrowserRTC4Chime.d.ts +55 -53
- package/dist/rtc/CoreRTC.d.ts +23 -0
- package/{lib/RTC → dist/rtc}/VRWebViewRTC.d.ts +22 -23
- package/dist/rtc/index.d.ts +5 -0
- package/{lib/typings/Chime → dist/typings/chime}/AttendeeResponse.d.ts +5 -5
- package/{lib/typings/Chime → dist/typings/chime}/MeetingResponse.d.ts +12 -12
- package/{lib/typings/Chime → dist/typings/chime}/MeetingSessionConfigurationOptions.d.ts +16 -16
- package/dist/typings/chime/index.d.ts +3 -0
- package/dist/typings/index.d.ts +4 -0
- package/{lib/typings → dist/typings/live}/EventType.d.ts +90 -89
- package/{lib/typings → dist/typings/live}/GetVoiceSign.d.ts +17 -11
- package/{lib/typings → dist/typings/live}/Live.d.ts +123 -122
- package/{lib/typings → dist/typings/live}/LiveMsg.d.ts +119 -119
- package/{lib/typings → dist/typings/live}/LiveOptions.d.ts +65 -46
- package/{lib/typings → dist/typings/live}/RoomInfo.d.ts +13 -13
- package/{lib/typings → dist/typings/live}/UserInfo.d.ts +87 -87
- package/dist/typings/live/UserVolume.d.ts +7 -0
- package/{lib/typings → dist/typings/live}/WebSocket.d.ts +78 -78
- package/dist/typings/live/index.d.ts +9 -0
- package/{lib/createLiveReact.d.ts → dist/typings/react/LiveReact.d.ts} +162 -160
- package/dist/typings/react/RTCActionReactCallback.d.ts +2 -0
- package/dist/typings/react/index.d.ts +2 -0
- package/dist/typings/rtc/VRWebViewRTCOptions.d.ts +6 -0
- package/{lib/typings/RTCEventType.d.ts → dist/typings/rtc/eventType.d.ts} +29 -35
- package/dist/typings/rtc/index.d.ts +5 -0
- package/{lib/typings/RTCJoinedInfo.d.ts → dist/typings/rtc/joinedInfo.d.ts} +34 -28
- package/{lib/typings/RTCProtocol.d.ts → dist/typings/rtc/protocol.d.ts} +53 -42
- package/dist/typings/rtc/type.d.ts +8 -0
- package/{lib/shared-utils → dist/utils}/appendUri.d.ts +1 -1
- package/dist/utils/clientDetector.d.ts +4 -0
- package/{lib/shared-utils → dist/utils}/equal.d.ts +10 -11
- package/{lib/shared-utils/Subscribe.d.ts → dist/utils/subscribe.d.ts} +75 -76
- package/{lib/shared-utils → dist/utils}/uuid.d.ts +4 -4
- package/package.json +22 -36
- package/docs/.nojekyll +0 -1
- package/docs/assets/custom.css +0 -43
- package/docs/assets/highlight.css +0 -127
- package/docs/assets/icons.css +0 -1043
- package/docs/assets/icons.png +0 -0
- package/docs/assets/icons@2x.png +0 -0
- package/docs/assets/main.js +0 -52
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1388
- package/docs/assets/widgets.png +0 -0
- package/docs/assets/widgets@2x.png +0 -0
- package/docs/classes/RTCProtocol.BrowserRTC.html +0 -60
- package/docs/classes/RTCProtocol.BrowserRTC4Chime.html +0 -66
- package/docs/classes/RTCProtocol.RTCExample.html +0 -62
- package/docs/classes/RTCProtocol.VRWebViewRTC.html +0 -60
- package/docs/classes/shared_utils.Subscribe.html +0 -56
- package/docs/enums/RTCProtocol.RTCJoinedInfoCodeEnum.html +0 -9
- package/docs/enums/RTCProtocol.RTCType.html +0 -1
- package/docs/enums/live.BuiltinActionType.html +0 -15
- package/docs/enums/live.BuiltinEventType.html +0 -7
- package/docs/enums/live.Command.html +0 -7
- package/docs/enums/live.MemUserStatus.html +0 -1
- package/docs/enums/live.MicroStatus.html +0 -3
- package/docs/enums/live.UserStatus.html +0 -9
- package/docs/enums/live.WebSocketCloseError.html +0 -19
- package/docs/enums/live.WebSocketErrorType.html +0 -1
- package/docs/enums/live.WebSocketState.html +0 -13
- package/docs/index.html +0 -382
- package/docs/interfaces/RTCProtocol.GetVoiceSignReturnType.html +0 -1
- package/docs/interfaces/RTCProtocol.RTCJoinedInfo.html +0 -1
- package/docs/interfaces/RTCProtocol.RTCProtocol-1.html +0 -60
- package/docs/interfaces/RTCProtocol.VRWebViewRTCOptions.html +0 -1
- package/docs/interfaces/live.Live.html +0 -119
- package/docs/interfaces/live.LiveOptions.html +0 -22
- package/docs/interfaces/live.LiveReact.html +0 -52
- package/docs/modules/RTCProtocol.html +0 -17
- package/docs/modules/live.html +0 -103
- package/docs/modules/shared_utils.html +0 -10
- package/docs/modules.html +0 -1
- package/lib/RTC/BrowserRTC.js +0 -169
- package/lib/RTC/BrowserRTC.js.map +0 -1
- package/lib/RTC/BrowserRTC4Chime.js +0 -299
- package/lib/RTC/BrowserRTC4Chime.js.map +0 -1
- package/lib/RTC/VRWebViewRTC.js +0 -125
- package/lib/RTC/VRWebViewRTC.js.map +0 -1
- package/lib/RTC/index.d.ts +0 -22
- package/lib/RTC/index.js +0 -50
- package/lib/RTC/index.js.map +0 -1
- package/lib/createLive.js +0 -590
- package/lib/createLive.js.map +0 -1
- package/lib/createLiveReact.js +0 -212
- package/lib/createLiveReact.js.map +0 -1
- package/lib/index.d.ts +0 -2
- package/lib/index.js +0 -8
- package/lib/index.js.map +0 -1
- package/lib/shared-utils/Subscribe.js +0 -134
- package/lib/shared-utils/Subscribe.js.map +0 -1
- package/lib/shared-utils/appendUri.js +0 -13
- package/lib/shared-utils/appendUri.js.map +0 -1
- package/lib/shared-utils/equal.js +0 -92
- package/lib/shared-utils/equal.js.map +0 -1
- package/lib/shared-utils/uuid.js +0 -17
- package/lib/shared-utils/uuid.js.map +0 -1
- package/lib/typings/Chime/AttendeeResponse.js +0 -3
- package/lib/typings/Chime/AttendeeResponse.js.map +0 -1
- package/lib/typings/Chime/MeetingResponse.js +0 -3
- package/lib/typings/Chime/MeetingResponse.js.map +0 -1
- package/lib/typings/Chime/MeetingSessionConfigurationOptions.js +0 -3
- package/lib/typings/Chime/MeetingSessionConfigurationOptions.js.map +0 -1
- package/lib/typings/EventType.js +0 -3
- package/lib/typings/EventType.js.map +0 -1
- package/lib/typings/GetVoiceSign.js +0 -3
- package/lib/typings/GetVoiceSign.js.map +0 -1
- package/lib/typings/Live.js +0 -3
- package/lib/typings/Live.js.map +0 -1
- package/lib/typings/LiveMsg.js +0 -111
- package/lib/typings/LiveMsg.js.map +0 -1
- package/lib/typings/LiveOptions.js +0 -3
- package/lib/typings/LiveOptions.js.map +0 -1
- package/lib/typings/RTCEventType.js +0 -3
- package/lib/typings/RTCEventType.js.map +0 -1
- package/lib/typings/RTCJoinedInfo.js +0 -23
- package/lib/typings/RTCJoinedInfo.js.map +0 -1
- package/lib/typings/RTCProtocol.js +0 -9
- package/lib/typings/RTCProtocol.js.map +0 -1
- package/lib/typings/RoomInfo.js +0 -3
- package/lib/typings/RoomInfo.js.map +0 -1
- package/lib/typings/UserInfo.js +0 -31
- package/lib/typings/UserInfo.js.map +0 -1
- package/lib/typings/VRWebViewRTCOptions.d.ts +0 -6
- package/lib/typings/VRWebViewRTCOptions.js +0 -3
- package/lib/typings/VRWebViewRTCOptions.js.map +0 -1
- package/lib/typings/WebSocket.js +0 -107
- package/lib/typings/WebSocket.js.map +0 -1
- package/umd/RTCProtocol.543610f0.js +0 -1
- package/umd/createLive.1ecf7dd4.js +0 -1
- package/umd/createLiveReact.9075a8fd.js +0 -1
|
@@ -1,30 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
private
|
|
11
|
-
private
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
private
|
|
28
|
-
private
|
|
29
|
-
|
|
30
|
-
}
|
|
1
|
+
import { GetVoiceSign } from '../typings/live/GetVoiceSign';
|
|
2
|
+
import { RTCType } from '../typings/rtc/type';
|
|
3
|
+
import { CoreRTC } from './CoreRTC';
|
|
4
|
+
export declare class BrowserRTC extends CoreRTC {
|
|
5
|
+
type: RTCType;
|
|
6
|
+
joined: boolean;
|
|
7
|
+
micro: boolean;
|
|
8
|
+
voiceId: string;
|
|
9
|
+
private _getVoiceSign;
|
|
10
|
+
private $dom;
|
|
11
|
+
private _trtc;
|
|
12
|
+
constructor(options: {
|
|
13
|
+
getVoiceSign: GetVoiceSign;
|
|
14
|
+
});
|
|
15
|
+
private _initParentDom;
|
|
16
|
+
join: (options: {
|
|
17
|
+
voiceId: string;
|
|
18
|
+
userId: string;
|
|
19
|
+
roomId: string;
|
|
20
|
+
type: RTCType;
|
|
21
|
+
}) => Promise<boolean>;
|
|
22
|
+
quit(): Promise<boolean>;
|
|
23
|
+
detectMicro(): Promise<boolean>;
|
|
24
|
+
toggleMicro(flag?: boolean): Promise<boolean>;
|
|
25
|
+
shock(): void;
|
|
26
|
+
private _registerRtcEvent;
|
|
27
|
+
private _handleStreamAdded;
|
|
28
|
+
private _handleStreamSubscribed;
|
|
29
|
+
}
|
|
@@ -1,53 +1,55 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
private
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
*
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
1
|
+
import { AudioVideoObserver, ConsoleLogger, DefaultDeviceController, DefaultMeetingSession, DeviceChangeObserver, LogLevel } from 'amazon-chime-sdk-js';
|
|
2
|
+
import { GetVoiceSign } from '../typings/live/GetVoiceSign';
|
|
3
|
+
import { RTCType } from '../typings/rtc/type';
|
|
4
|
+
import { CoreRTC } from './CoreRTC';
|
|
5
|
+
/**
|
|
6
|
+
* amazon-chime-sdk-js 适配的rtc实现
|
|
7
|
+
*/
|
|
8
|
+
export declare class BrowserRTC4Chime extends CoreRTC {
|
|
9
|
+
type: RTCType;
|
|
10
|
+
joined: boolean;
|
|
11
|
+
micro: boolean;
|
|
12
|
+
voiceId: string;
|
|
13
|
+
userId: string;
|
|
14
|
+
logger: ConsoleLogger;
|
|
15
|
+
deviceController: DefaultDeviceController;
|
|
16
|
+
meetingSession: DefaultMeetingSession | undefined;
|
|
17
|
+
audioInput: MediaDeviceInfo | undefined;
|
|
18
|
+
audioOutput: MediaDeviceInfo | undefined;
|
|
19
|
+
deviceChangeObserver: DeviceChangeObserver;
|
|
20
|
+
audioVideoObserver: AudioVideoObserver;
|
|
21
|
+
private _getVoiceSign;
|
|
22
|
+
private $dom;
|
|
23
|
+
private $audio;
|
|
24
|
+
constructor(options: {
|
|
25
|
+
getVoiceSign: GetVoiceSign;
|
|
26
|
+
logLevel?: LogLevel;
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* 对audio标签初始化
|
|
30
|
+
*/
|
|
31
|
+
_initDom: () => void;
|
|
32
|
+
/**
|
|
33
|
+
* 初始化事件监听器
|
|
34
|
+
*/
|
|
35
|
+
initObservers: () => void;
|
|
36
|
+
/**
|
|
37
|
+
* 加入语音会议
|
|
38
|
+
* @param options
|
|
39
|
+
* @returns
|
|
40
|
+
*/
|
|
41
|
+
join(options: {
|
|
42
|
+
voiceId: string;
|
|
43
|
+
userId: string;
|
|
44
|
+
roomId: string | number | undefined;
|
|
45
|
+
type: RTCType;
|
|
46
|
+
}): Promise<boolean>;
|
|
47
|
+
/**
|
|
48
|
+
* 注册rtc事件
|
|
49
|
+
*/
|
|
50
|
+
_registerRtcEvent: () => void;
|
|
51
|
+
quit(): Promise<boolean>;
|
|
52
|
+
detectMicro(): Promise<boolean>;
|
|
53
|
+
toggleMicro(flag?: boolean): Promise<boolean>;
|
|
54
|
+
shock(): void;
|
|
55
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { RTCEventType } from '../typings/rtc/eventType';
|
|
2
|
+
import { RTCProtocol } from '../typings/rtc/protocol';
|
|
3
|
+
import { RTCType } from '../typings/rtc/type';
|
|
4
|
+
import { Subscribe } from '../utils/subscribe';
|
|
5
|
+
/**
|
|
6
|
+
* rtc 基础抽象类
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class CoreRTC extends Subscribe<RTCEventType> implements RTCProtocol {
|
|
9
|
+
abstract joined: boolean;
|
|
10
|
+
abstract micro: boolean;
|
|
11
|
+
abstract voiceId: string;
|
|
12
|
+
abstract type: RTCType;
|
|
13
|
+
abstract join(options: {
|
|
14
|
+
voiceId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
roomId: string | number | undefined;
|
|
17
|
+
type: RTCType;
|
|
18
|
+
}): Promise<boolean>;
|
|
19
|
+
abstract quit(): Promise<boolean>;
|
|
20
|
+
abstract detectMicro(): Promise<boolean>;
|
|
21
|
+
abstract toggleMicro(flag?: boolean): Promise<boolean>;
|
|
22
|
+
abstract shock(): void;
|
|
23
|
+
}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
}
|
|
1
|
+
import { RTCType } from '../typings/rtc/type';
|
|
2
|
+
import { VRWebViewRTCOptions } from '../typings/rtc/VRWebViewRTCOptions';
|
|
3
|
+
import { CoreRTC } from './CoreRTC';
|
|
4
|
+
export declare class VRWebViewRTC extends CoreRTC {
|
|
5
|
+
type: RTCType;
|
|
6
|
+
joined: boolean;
|
|
7
|
+
micro: boolean;
|
|
8
|
+
voiceId: string;
|
|
9
|
+
private options;
|
|
10
|
+
get jsBridge(): import("@realsee/jsbridge-x").JSBridgeProtocol;
|
|
11
|
+
constructor({ jsBridge, getVoiceSign }: VRWebViewRTCOptions);
|
|
12
|
+
join(options: {
|
|
13
|
+
voiceId: string;
|
|
14
|
+
userId: string;
|
|
15
|
+
roomId: string;
|
|
16
|
+
type: RTCType;
|
|
17
|
+
}): Promise<boolean>;
|
|
18
|
+
quit(): Promise<boolean>;
|
|
19
|
+
detectMicro(): Promise<boolean>;
|
|
20
|
+
toggleMicro(flag?: boolean): Promise<boolean>;
|
|
21
|
+
shock(): void;
|
|
22
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export interface AttendeeResponse {
|
|
2
|
-
attendee_id: string;
|
|
3
|
-
external_user_id: string;
|
|
4
|
-
join_token: string;
|
|
5
|
-
}
|
|
1
|
+
export interface AttendeeResponse {
|
|
2
|
+
attendee_id: string;
|
|
3
|
+
external_user_id: string;
|
|
4
|
+
join_token: string;
|
|
5
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
export interface MeetingResponse {
|
|
2
|
-
MediaPlacement: {
|
|
3
|
-
AudioFallbackUrl: string;
|
|
4
|
-
AudioHostUrl: string;
|
|
5
|
-
ScreenDataUrl: string;
|
|
6
|
-
ScreenSharingUrl: string;
|
|
7
|
-
ScreenViewingUrl: string;
|
|
8
|
-
SignalingUrl: string;
|
|
9
|
-
TurnControlUrl: string;
|
|
10
|
-
};
|
|
11
|
-
MeetingId: string;
|
|
12
|
-
}
|
|
1
|
+
export interface MeetingResponse {
|
|
2
|
+
MediaPlacement: {
|
|
3
|
+
AudioFallbackUrl: string;
|
|
4
|
+
AudioHostUrl: string;
|
|
5
|
+
ScreenDataUrl: string;
|
|
6
|
+
ScreenSharingUrl: string;
|
|
7
|
+
ScreenViewingUrl: string;
|
|
8
|
+
SignalingUrl: string;
|
|
9
|
+
TurnControlUrl: string;
|
|
10
|
+
};
|
|
11
|
+
MeetingId: string;
|
|
12
|
+
}
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { AttendeeResponse } from "./AttendeeResponse";
|
|
2
|
-
import { MeetingResponse } from "./MeetingResponse";
|
|
3
|
-
export interface MeetingSessionConfigurationOptions {
|
|
4
|
-
attendence: AttendeeResponse;
|
|
5
|
-
config: {
|
|
6
|
-
passport: string;
|
|
7
|
-
vendor: string;
|
|
8
|
-
app_id: string;
|
|
9
|
-
bypass: any;
|
|
10
|
-
};
|
|
11
|
-
expire_time: number;
|
|
12
|
-
identifier: string;
|
|
13
|
-
user_id: string;
|
|
14
|
-
user_sig: string;
|
|
15
|
-
vendor_wrapper: MeetingResponse;
|
|
16
|
-
}
|
|
1
|
+
import { AttendeeResponse } from "./AttendeeResponse";
|
|
2
|
+
import { MeetingResponse } from "./MeetingResponse";
|
|
3
|
+
export interface MeetingSessionConfigurationOptions {
|
|
4
|
+
attendence: AttendeeResponse;
|
|
5
|
+
config: {
|
|
6
|
+
passport: string;
|
|
7
|
+
vendor: string;
|
|
8
|
+
app_id: string;
|
|
9
|
+
bypass: any;
|
|
10
|
+
};
|
|
11
|
+
expire_time: number;
|
|
12
|
+
identifier: string;
|
|
13
|
+
user_id: string;
|
|
14
|
+
user_sig: string;
|
|
15
|
+
vendor_wrapper: MeetingResponse;
|
|
16
|
+
}
|
|
@@ -1,89 +1,90 @@
|
|
|
1
|
-
import { BuiltinMsg, LiveMsg } from './LiveMsg';
|
|
2
|
-
import { UserInfo } from './UserInfo';
|
|
3
|
-
import { WebSocketError, WebSocketState } from './WebSocket';
|
|
4
|
-
/**
|
|
5
|
-
* WebSocket 相关异步事件
|
|
6
|
-
* @description
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
*
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
*
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
*
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
*
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
*
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
*
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
*
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
*
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
*
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
*
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
*
|
|
77
|
-
*
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
*
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
1
|
+
import { BuiltinMsg, LiveMsg } from './LiveMsg';
|
|
2
|
+
import { UserInfo } from './UserInfo';
|
|
3
|
+
import { WebSocketError, WebSocketState } from './WebSocket';
|
|
4
|
+
/**
|
|
5
|
+
* WebSocket 相关异步事件
|
|
6
|
+
* @description
|
|
7
|
+
* @deprecated 这些事件不应暴露给应用层
|
|
8
|
+
*/
|
|
9
|
+
declare type WebSocketEventType = {
|
|
10
|
+
/**
|
|
11
|
+
* WebSocket 状态发生更新
|
|
12
|
+
* @param readyState - 当前状态枚举值。
|
|
13
|
+
*/
|
|
14
|
+
'ws.readyStateUpdate'(readyState: WebSocketState): void;
|
|
15
|
+
/**
|
|
16
|
+
* WebSocket 连接前
|
|
17
|
+
*/
|
|
18
|
+
'ws.beforeConnect'(reConnect?: number): void;
|
|
19
|
+
/**
|
|
20
|
+
* WebSocket 连接后
|
|
21
|
+
*/
|
|
22
|
+
'ws.afterConnect'(reConnect?: number): void;
|
|
23
|
+
/**
|
|
24
|
+
* WebSocket 连接过程中遭遇的异常情况信息。
|
|
25
|
+
* @param error - 错误信息。
|
|
26
|
+
*/
|
|
27
|
+
'ws.error'(error: WebSocketError): void;
|
|
28
|
+
/**
|
|
29
|
+
* WebSocket 收到的消息
|
|
30
|
+
* @param liveMsg - 透传 WebSocket 消息
|
|
31
|
+
*/
|
|
32
|
+
'ws.message'(liveMsg: LiveMsg): void;
|
|
33
|
+
};
|
|
34
|
+
declare type LiveEventType<Snapshot> = {
|
|
35
|
+
/**
|
|
36
|
+
* 内置消息事件
|
|
37
|
+
* @param builtinMsg
|
|
38
|
+
*/
|
|
39
|
+
'builtinEvent'(builtinMsg: BuiltinMsg): void;
|
|
40
|
+
/**
|
|
41
|
+
* 内置消息事件: 用户信息改变
|
|
42
|
+
* @param builtinMsg
|
|
43
|
+
*/
|
|
44
|
+
'userChange'(builtinMsg: BuiltinMsg): void;
|
|
45
|
+
/**
|
|
46
|
+
* 内置消息事件:房间信息改变
|
|
47
|
+
* @param builtinMsg
|
|
48
|
+
*/
|
|
49
|
+
'roomChange'(builtinMsg: BuiltinMsg): void;
|
|
50
|
+
/**
|
|
51
|
+
* 收到其他用户的广播消息。
|
|
52
|
+
* @param evtMsg
|
|
53
|
+
*/
|
|
54
|
+
'broadcast'(evtMsg: Record<string, any>, frontRequestId: string): void;
|
|
55
|
+
/**
|
|
56
|
+
* 带看已经就绪,可以发送帧数据。
|
|
57
|
+
* @param lastKeyframe 带看最后一帧数据(链接切换、断网等重连恢复上次会话帧状态),你可以通过此数据拉齐当前UI状态。
|
|
58
|
+
*/
|
|
59
|
+
'readyKeyframeSync'(lastKeyframe: Partial<Snapshot>): void;
|
|
60
|
+
/**
|
|
61
|
+
* 获取其他用户输送的帧数据:根据此帧数据更新UI状态。
|
|
62
|
+
* @param keyframes
|
|
63
|
+
*/
|
|
64
|
+
'keyframes'(keyframes: Partial<Snapshot>, frontRequestId: string): void;
|
|
65
|
+
/**
|
|
66
|
+
* 个人信息发生更新。
|
|
67
|
+
* @param userInfo
|
|
68
|
+
*/
|
|
69
|
+
'selfInfoUpdate'(userInfo: UserInfo, frontRequestId: string): void;
|
|
70
|
+
/**
|
|
71
|
+
* 用户列表更新。
|
|
72
|
+
* @param userList
|
|
73
|
+
*/
|
|
74
|
+
'userListUpdate'(userList: UserInfo[], frontRequestId: string): void;
|
|
75
|
+
/**
|
|
76
|
+
* 被踢出房间
|
|
77
|
+
* @param
|
|
78
|
+
* */
|
|
79
|
+
'kickOut'(): void;
|
|
80
|
+
/**
|
|
81
|
+
* 异常消息:不符合规范。
|
|
82
|
+
* @param liveMsg
|
|
83
|
+
*/
|
|
84
|
+
'error'(liveMsg: LiveMsg): void;
|
|
85
|
+
};
|
|
86
|
+
declare type KeyframeTypes<Type> = {
|
|
87
|
+
[Property in keyof Type as Property]: (nextKeyframes: Type[Property], prevKeyframes: Type[Property], frontRequestId: string) => void;
|
|
88
|
+
};
|
|
89
|
+
declare type EventType<Snapshot> = LiveEventType<Snapshot> & WebSocketEventType;
|
|
90
|
+
export { LiveEventType, WebSocketEventType, KeyframeTypes, EventType };
|
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 语音签名的返回值
|
|
3
|
+
*/
|
|
4
|
+
export interface GetVoiceSignReturnType {
|
|
5
|
+
sdkAppId: number;
|
|
6
|
+
userId: string;
|
|
7
|
+
roomId: string | number;
|
|
8
|
+
userSig: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 获取用户语音签名
|
|
12
|
+
*/
|
|
13
|
+
export declare type GetVoiceSign = ({ voiceId, userId, roomId, }: {
|
|
14
|
+
voiceId: string;
|
|
15
|
+
userId: string;
|
|
16
|
+
roomId: string | number;
|
|
17
|
+
}) => Promise<GetVoiceSignReturnType>;
|