agora-rte-sdk 2.8.21 → 2.8.40
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.js +2 -2
- package/lib/configs/index.d.ts +8 -6
- package/lib/configs/index.js +8 -6
- package/lib/core/engine/index.js +1 -7
- package/lib/core/logger/index.d.ts +1 -0
- package/lib/core/logger/index.js +22 -2
- package/lib/core/logger/log.worker.js +4 -2
- package/lib/core/media/control.d.ts +11 -8
- package/lib/core/media/control.js +42 -32
- package/lib/core/media/player.d.ts +9 -0
- package/lib/core/media/player.js +36 -0
- package/lib/core/media/track.d.ts +8 -1
- package/lib/core/media/track.js +18 -0
- package/lib/core/media/type.d.ts +113 -0
- package/lib/core/media/type.js +31 -0
- package/lib/core/processor/channel-msg/data.d.ts +1 -0
- package/lib/core/processor/channel-msg/data.js +5 -0
- package/lib/core/processor/channel-msg/handler.d.ts +1 -3
- package/lib/core/processor/channel-msg/handler.js +20 -21
- package/lib/core/processor/channel-msg/message-parser.d.ts +6 -0
- package/lib/core/processor/channel-msg/message-parser.js +57 -0
- package/lib/core/processor/channel-msg/struct.d.ts +5 -0
- package/lib/core/processor/channel-msg/synchronizer.d.ts +7 -14
- package/lib/core/processor/channel-msg/synchronizer.js +33 -48
- package/lib/core/processor/peer-msg/handler.d.ts +16 -0
- package/lib/core/processor/peer-msg/handler.js +57 -0
- package/lib/core/processor/peer-msg/struct.d.ts +4 -0
- package/lib/core/processor/type.d.ts +200 -0
- package/lib/core/rc/index.js +6 -2
- package/lib/core/rtc/adapter/base.d.ts +6 -7
- package/lib/core/rtc/adapter/electron/device.d.ts +0 -1
- package/lib/core/rtc/adapter/electron/device.js +0 -5
- package/lib/core/rtc/adapter/electron/index.d.ts +6 -7
- package/lib/core/rtc/adapter/electron/index.js +22 -24
- package/lib/core/rtc/adapter/web/client.d.ts +11 -9
- package/lib/core/rtc/adapter/web/client.js +40 -38
- package/lib/core/rtc/adapter/web/device.d.ts +0 -1
- package/lib/core/rtc/adapter/web/device.js +0 -5
- package/lib/core/rtc/adapter/web/dispatcher.d.ts +61 -0
- package/lib/core/rtc/adapter/web/dispatcher.js +166 -0
- package/lib/core/rtc/adapter/web/index.d.ts +11 -7
- package/lib/core/rtc/adapter/web/index.js +25 -16
- package/lib/core/rtc/adapter/web/thread.d.ts +18 -11
- package/lib/core/rtc/adapter/web/thread.js +241 -133
- package/lib/core/rtc/channel.d.ts +2 -3
- package/lib/core/rtc/index.d.ts +5 -4
- package/lib/core/rtc/index.js +12 -12
- package/lib/core/rtc/type.d.ts +0 -4
- package/lib/core/services/api.d.ts +15 -0
- package/lib/core/services/api.js +36 -1
- package/lib/core/utils/events.d.ts +0 -1
- package/lib/index.d.ts +3 -1
- package/lib/index.js +24 -17
- package/lib/scene/index.d.ts +1 -5
- package/lib/scene/index.js +88 -66
- package/lib/scene/state-sync.d.ts +21 -0
- package/lib/scene/state-sync.js +169 -0
- package/package.json +1 -1
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import Immutable from 'immutable';
|
|
2
|
+
import { AgoraRteAudioSourceType, AgoraRteMediaPublishState, AgoraRteVideoSourceType } from '../media/track';
|
|
3
|
+
import { AgoraRteMediaSourceState } from '../rtc/type';
|
|
4
|
+
export declare type AgoraFromUser = {
|
|
5
|
+
userUuid: string;
|
|
6
|
+
userName: string;
|
|
7
|
+
role: string;
|
|
8
|
+
};
|
|
9
|
+
export declare type MessageExt = {
|
|
10
|
+
range: number;
|
|
11
|
+
userName: string;
|
|
12
|
+
userUuid: string;
|
|
13
|
+
};
|
|
14
|
+
export interface IAgoraUserData {
|
|
15
|
+
userName: string;
|
|
16
|
+
role: string;
|
|
17
|
+
userUuid: string;
|
|
18
|
+
userProperties: any;
|
|
19
|
+
}
|
|
20
|
+
export declare class AgoraUser {
|
|
21
|
+
static fromData(data: any): AgoraUser;
|
|
22
|
+
userUuid: string;
|
|
23
|
+
userName: string;
|
|
24
|
+
userRole: string;
|
|
25
|
+
userProperties: Immutable.Map<any, any>;
|
|
26
|
+
constructor(data: IAgoraUserData);
|
|
27
|
+
setUserProperties(userProperties: any): void;
|
|
28
|
+
toString(): string;
|
|
29
|
+
}
|
|
30
|
+
export interface IAgoraStreamData {
|
|
31
|
+
streamUuid: string;
|
|
32
|
+
streamName: string;
|
|
33
|
+
fromUser: AgoraFromUser;
|
|
34
|
+
videoSourceType: AgoraRteVideoSourceType;
|
|
35
|
+
audioSourceType: AgoraRteAudioSourceType;
|
|
36
|
+
videoState: AgoraRteMediaPublishState;
|
|
37
|
+
audioState: AgoraRteMediaPublishState;
|
|
38
|
+
videoSourceState: AgoraRteMediaSourceState;
|
|
39
|
+
audioSourceState: AgoraRteMediaSourceState;
|
|
40
|
+
playUrl?: string;
|
|
41
|
+
flvPlayUrl?: string;
|
|
42
|
+
rtmpPlayUrl?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare class AgoraStream {
|
|
45
|
+
static fromData(data: IAgoraStreamData): AgoraStream;
|
|
46
|
+
streamUuid: string;
|
|
47
|
+
streamName: string;
|
|
48
|
+
fromUser: AgoraFromUser;
|
|
49
|
+
videoSourceType: AgoraRteVideoSourceType;
|
|
50
|
+
audioSourceType: AgoraRteAudioSourceType;
|
|
51
|
+
videoState: AgoraRteMediaPublishState;
|
|
52
|
+
audioState: AgoraRteMediaPublishState;
|
|
53
|
+
videoSourceState: AgoraRteMediaSourceState;
|
|
54
|
+
audioSourceState: AgoraRteMediaSourceState;
|
|
55
|
+
playUrl?: string;
|
|
56
|
+
flvPlayUrl?: string;
|
|
57
|
+
rtmpPlayUrl?: string;
|
|
58
|
+
previous?: AgoraStream;
|
|
59
|
+
constructor(data: IAgoraStreamData);
|
|
60
|
+
toString(): string;
|
|
61
|
+
}
|
|
62
|
+
export interface IAgoraRoomStateData {
|
|
63
|
+
total: number;
|
|
64
|
+
}
|
|
65
|
+
export interface IAgoraRoomData {
|
|
66
|
+
roomName: string;
|
|
67
|
+
roomUuid: string;
|
|
68
|
+
roomScenario: string;
|
|
69
|
+
}
|
|
70
|
+
export declare class AgoraRoom {
|
|
71
|
+
static fromData(data: any): AgoraRoom;
|
|
72
|
+
roomName: string;
|
|
73
|
+
roomUuid: string;
|
|
74
|
+
roomScenario: string;
|
|
75
|
+
constructor(data: IAgoraRoomData);
|
|
76
|
+
}
|
|
77
|
+
export declare class AgoraRoomState {
|
|
78
|
+
static fromData(data: IAgoraRoomStateData): AgoraRoomState;
|
|
79
|
+
total: number;
|
|
80
|
+
constructor(data: IAgoraRoomStateData);
|
|
81
|
+
}
|
|
82
|
+
export interface IAgoraChatMessage {
|
|
83
|
+
fromUser: AgoraFromUser;
|
|
84
|
+
message: string;
|
|
85
|
+
type: number;
|
|
86
|
+
sendTime: number;
|
|
87
|
+
sensitiveWords: string[];
|
|
88
|
+
messageId?: string;
|
|
89
|
+
peerMessageId?: string;
|
|
90
|
+
ext?: MessageExt;
|
|
91
|
+
}
|
|
92
|
+
export declare class AgoraChatMessage {
|
|
93
|
+
static fromData(data: IAgoraChatMessage): AgoraChatMessage;
|
|
94
|
+
fromUser: AgoraFromUser;
|
|
95
|
+
message: string;
|
|
96
|
+
type: number;
|
|
97
|
+
sendTime: number;
|
|
98
|
+
sensitiveWords: string[];
|
|
99
|
+
messageId?: string;
|
|
100
|
+
ext?: MessageExt;
|
|
101
|
+
constructor(data: IAgoraChatMessage);
|
|
102
|
+
toString(): string;
|
|
103
|
+
}
|
|
104
|
+
export interface AgoraRteOperator {
|
|
105
|
+
userUuid: string;
|
|
106
|
+
userName: string;
|
|
107
|
+
role: string;
|
|
108
|
+
}
|
|
109
|
+
export interface AgoraRteMessageBatch {
|
|
110
|
+
id: number;
|
|
111
|
+
total: number;
|
|
112
|
+
progress: number;
|
|
113
|
+
}
|
|
114
|
+
export interface AgoraRteMessageBatchDetail {
|
|
115
|
+
cause: {
|
|
116
|
+
cmd: number;
|
|
117
|
+
};
|
|
118
|
+
operator: AgoraRteOperator;
|
|
119
|
+
version: number;
|
|
120
|
+
sequence: number;
|
|
121
|
+
ts: number;
|
|
122
|
+
}
|
|
123
|
+
export interface AgoraRteSequenceMessage {
|
|
124
|
+
cmd: number;
|
|
125
|
+
operator: AgoraRteOperator;
|
|
126
|
+
sequence: number;
|
|
127
|
+
data: any;
|
|
128
|
+
timestamp: number;
|
|
129
|
+
batch?: AgoraRteMessageBatch;
|
|
130
|
+
list?: AgoraRteMessageBatchDetail[];
|
|
131
|
+
}
|
|
132
|
+
export interface AgoraRteMessagePacket {
|
|
133
|
+
total: number;
|
|
134
|
+
startSequence: number;
|
|
135
|
+
list: AgoraRteSequenceMessage[];
|
|
136
|
+
}
|
|
137
|
+
export interface AgoraRteMessageHandle {
|
|
138
|
+
on(evt: AgoraRteEventType, ...args: any[]): this;
|
|
139
|
+
off(evt: AgoraRteEventType, ...args: any[]): this;
|
|
140
|
+
handleSnapshot(snapshot: AgoraRteSyncSnapshotData): void;
|
|
141
|
+
handleSeqMessage(message: AgoraRteSequenceMessage): void;
|
|
142
|
+
handleNonSeqMessage(message: unknown): void;
|
|
143
|
+
}
|
|
144
|
+
export declare class AgoraRteSyncSnapshotData {
|
|
145
|
+
static fromData(data: any): AgoraRteSyncSnapshotData;
|
|
146
|
+
sequence: number;
|
|
147
|
+
users: Map<string, AgoraUser>;
|
|
148
|
+
streams: Map<string, AgoraStream>;
|
|
149
|
+
roomProperties: Immutable.Map<unknown, unknown>;
|
|
150
|
+
room: AgoraRoom;
|
|
151
|
+
roomState: AgoraRoomState;
|
|
152
|
+
constructor(data: any);
|
|
153
|
+
}
|
|
154
|
+
export declare enum AgoraRteChannelMessageCmd {
|
|
155
|
+
Chat = 3,
|
|
156
|
+
RoomProperty = 4,
|
|
157
|
+
RoomProperties = 5,
|
|
158
|
+
UserInOut = 20,
|
|
159
|
+
UserInfo = 21,
|
|
160
|
+
UserProperty = 22,
|
|
161
|
+
UserProperties = 23,
|
|
162
|
+
UserSubscribeInOut = 24,
|
|
163
|
+
StreamInOut = 40,
|
|
164
|
+
StreamsInOut = 41,
|
|
165
|
+
MessageExtension = 99
|
|
166
|
+
}
|
|
167
|
+
export declare enum AgoraRtePeerMessageCmd {
|
|
168
|
+
PeerChat = 1
|
|
169
|
+
}
|
|
170
|
+
export declare enum AgoraRteEventType {
|
|
171
|
+
SnapshotUpdated = "snapshot-updated",
|
|
172
|
+
ChatReceived = "chat-received",
|
|
173
|
+
UserAdded = "user-added",
|
|
174
|
+
UserUpdated = "user-updated",
|
|
175
|
+
UserRemoved = "user-removed",
|
|
176
|
+
UserCountUpdated = "user-count-updated",
|
|
177
|
+
RoomPropertyUpdated = "room-property-updated",
|
|
178
|
+
UserPropertyUpdated = "user-property-updated",
|
|
179
|
+
LocalStreamAdded = "local-stream-added",
|
|
180
|
+
LocalStreamUpdate = "local-stream-update",
|
|
181
|
+
LocalStreamRemove = "local-stream-removed",
|
|
182
|
+
RemoteStreamAdded = "remote-stream-added",
|
|
183
|
+
RemoteStreamUpdate = "remote-stream-update",
|
|
184
|
+
RemoteStreamRemove = "remote-stream-removed",
|
|
185
|
+
ChatUserMessage = "user-chat-message",
|
|
186
|
+
ChatRoomMessage = "room-chat-message",
|
|
187
|
+
NetworkStats = "network-stats",
|
|
188
|
+
LocalAudioVolume = "local-audio-volume",
|
|
189
|
+
AudioVolumes = "audio-volumes",
|
|
190
|
+
LocalVideoCameraListChanged = "local-video-camera-list-changed",
|
|
191
|
+
LocalAudioRecordingListChanged = "local-audio-recording-list-changed",
|
|
192
|
+
LocalAudioPlaybackListChanged = "local-audio-playback-list-changed",
|
|
193
|
+
LocalVideoTrackStateChanged = "local-video-track-state-changed",
|
|
194
|
+
LocalAudioTrackStateChanged = "local-audio-track-state-changed",
|
|
195
|
+
RtcConnectionStateChanged = "rtc-connection-state-changed",
|
|
196
|
+
RtmConnectionStateChanged = "rtm-connection-state-changed",
|
|
197
|
+
RteConnectionStateChanged = "rte-connection-state-changed",
|
|
198
|
+
TimeStampGapUpdate = "timestamp-gap-update",
|
|
199
|
+
UserPropertyListUpdated = "user-property-list-updated"
|
|
200
|
+
}
|
package/lib/core/rc/index.js
CHANGED
|
@@ -597,8 +597,12 @@ var AgoraRemoteControlContext = (_dec = _decorator.Log.attach({
|
|
|
597
597
|
key: "cleanup",
|
|
598
598
|
value: function cleanup() {
|
|
599
599
|
AgoraRemoteControlContext._channelUsers.clear();
|
|
600
|
-
_electron.RtcAdapterElectron.rtcEngine
|
|
601
|
-
|
|
600
|
+
if (_electron.RtcAdapterElectron.rtcEngine) {
|
|
601
|
+
_electron.RtcAdapterElectron.rtcEngine.off('userJoined', AgoraRemoteControlContext.handleRTCUserJoined);
|
|
602
|
+
}
|
|
603
|
+
if (_electron.RtcAdapterElectron.rtcEngine) {
|
|
604
|
+
_electron.RtcAdapterElectron.rtcEngine.off('removeStream', AgoraRemoteControlContext.handleRTCUserLeft);
|
|
605
|
+
}
|
|
602
606
|
}
|
|
603
607
|
}]);
|
|
604
608
|
return AgoraRemoteControlContext;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { RemoteStreamType } from 'agora-rtc-sdk-ng';
|
|
2
1
|
import { AgoraLatencyLevel } from '../../../configs';
|
|
3
2
|
import { AgoraRteAudioSourceType, AgoraRteVideoSourceType } from '../../media/track';
|
|
4
3
|
import { AGEventEmitter } from '../../utils/events';
|
|
5
4
|
import { AgoraRtcVideoCanvas } from '../canvas';
|
|
6
5
|
import { AGRtcConnectionType } from '../channel';
|
|
7
6
|
import { IBaseProcessor } from 'agora-rte-extension';
|
|
8
|
-
import { AgoraRteMediaSourceState, AGRtcDeviceInfo, AGScreenShareDevice, AGScreenShareType, AGBeautyEffect,
|
|
7
|
+
import { AgoraRteMediaSourceState, AGRtcDeviceInfo, AGScreenShareDevice, AGScreenShareType, AGBeautyEffect, AGSnapshotInfo, AGNetworkStats, AGRtcState, AGLowStreamParameter, AGRemoteVideoStreamType } from '../type';
|
|
8
|
+
import { AgoraRteAudioRawDataConfig, AgoraRteAudioRawDataObserver, AgoraRteAudioRawDataPosition } from '../../media/type';
|
|
9
9
|
export declare type LocalVideoTrackStateEvent = (state: AgoraRteMediaSourceState, type: AgoraRteVideoSourceType) => void;
|
|
10
10
|
export declare type LocalAudioTrackStateEvent = (state: AgoraRteMediaSourceState, type: AgoraRteAudioSourceType) => void;
|
|
11
11
|
export declare type LocalCameraDeviceListEvent = (addNewDevice: boolean, newDevices: AGRtcDeviceInfo[], allDevices: AGRtcDeviceInfo[]) => void;
|
|
@@ -25,7 +25,6 @@ export declare abstract class RtcAudioDeviceManagerBase extends AGEventEmitter {
|
|
|
25
25
|
abstract onLocalAudioTrackStateChanged(cb: LocalAudioTrackStateEvent): number;
|
|
26
26
|
abstract onLocalAudioVolume(cb: (volume: number) => void): number;
|
|
27
27
|
abstract onLocalAudioPlaybackTestVolumeChanged(cb: LocalAudioPlaybackVolumeIndicatorEvent): number;
|
|
28
|
-
abstract onAudioFrame(cb: (buffer: ArrayBuffer) => void): number;
|
|
29
28
|
}
|
|
30
29
|
export declare abstract class RtcChannelAdapterBase extends AGEventEmitter {
|
|
31
30
|
abstract join(token: string, streamUuid: string, connectionType: AGRtcConnectionType): Promise<void>;
|
|
@@ -33,7 +32,7 @@ export declare abstract class RtcChannelAdapterBase extends AGEventEmitter {
|
|
|
33
32
|
abstract leave(connectionType?: AGRtcConnectionType): Promise<void>;
|
|
34
33
|
abstract enableDualStream(enable: boolean, connectionType?: AGRtcConnectionType): Promise<void>;
|
|
35
34
|
abstract setLowStreamParameter(streamParameter: AGLowStreamParameter, connectionType?: AGRtcConnectionType): number;
|
|
36
|
-
abstract setRemoteVideoStreamType(streamUuid: string, streamType:
|
|
35
|
+
abstract setRemoteVideoStreamType(streamUuid: string, streamType: AGRemoteVideoStreamType, connectionType: AGRtcConnectionType): Promise<void>;
|
|
37
36
|
abstract muteLocalVideo(mute: boolean, connectionType: AGRtcConnectionType): number;
|
|
38
37
|
abstract muteLocalAudio(mute: boolean, connectionType: AGRtcConnectionType): number;
|
|
39
38
|
abstract muteLocalScreenShare(mute: boolean, connectionType: AGRtcConnectionType): number;
|
|
@@ -79,9 +78,9 @@ export declare abstract class RtcAdapterBase extends AGEventEmitter {
|
|
|
79
78
|
abstract onLocalScreenShareTrackStateChanged(cb: LocalVideoTrackStateEvent): number;
|
|
80
79
|
abstract destroy(): number;
|
|
81
80
|
abstract setBeautyEffectOptions(enable: boolean, options: AGBeautyEffect): number;
|
|
82
|
-
abstract setAudioRawDataConfig(config:
|
|
83
|
-
abstract
|
|
84
|
-
abstract
|
|
81
|
+
abstract setAudioRawDataConfig(config: AgoraRteAudioRawDataConfig, position: AgoraRteAudioRawDataPosition): number;
|
|
82
|
+
abstract addAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver, position: AgoraRteAudioRawDataPosition): number;
|
|
83
|
+
abstract removeAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver, position: AgoraRteAudioRawDataPosition): number;
|
|
85
84
|
static getRtcVersion(): string;
|
|
86
85
|
abstract hasScreenSharePermission(): boolean;
|
|
87
86
|
abstract takeSnapshot(channel: string, streamUuid: number, filePath: string): Promise<AGSnapshotInfo | void>;
|
|
@@ -268,11 +268,6 @@ var RtcAudioDeviceManagerElectron = /*#__PURE__*/function (_RtcAudioDeviceManage
|
|
|
268
268
|
});
|
|
269
269
|
this._emitRecordingListChanged(true, newDevices, this.microphoneList);
|
|
270
270
|
}
|
|
271
|
-
}, {
|
|
272
|
-
key: "onAudioFrame",
|
|
273
|
-
value: function onAudioFrame(cb) {
|
|
274
|
-
return 0;
|
|
275
|
-
}
|
|
276
271
|
}]);
|
|
277
272
|
return RtcAudioDeviceManagerElectron;
|
|
278
273
|
}(_base.RtcAudioDeviceManagerBase);
|
|
@@ -3,13 +3,13 @@ import type AgoraRtcEngine from 'agora-electron-sdk/types/AgoraSdk';
|
|
|
3
3
|
import { AgoraRteVideoSourceType } from '../../../media/track';
|
|
4
4
|
import { AgoraRtcVideoCanvas } from '../../canvas';
|
|
5
5
|
import { AGRtcConnectionType } from '../../channel';
|
|
6
|
-
import { AGScreenShareDevice, AGScreenShareType, AGBeautyEffect,
|
|
6
|
+
import { AGScreenShareDevice, AGScreenShareType, AGBeautyEffect, AGSnapshotInfo, AGNetworkStats, AGRtcState, AGLowStreamParameter, AGRemoteVideoStreamType } from '../../type';
|
|
7
7
|
import { LocalVideoTrackStateEvent, LocalAudioTrackStateEvent, RtcAdapterBase, RtcAudioDeviceManagerBase, RtcChannelAdapterBase, RtcVideoDeviceManagerBase, LocalAudioPlaybackVolumeIndicatorEvent } from '../base';
|
|
8
8
|
import { AgoraRteElectronCameraThread } from './thread';
|
|
9
9
|
import { AgoraLatencyLevel } from '../../../../configs';
|
|
10
10
|
import { AGChannelProfile } from '../../../../type';
|
|
11
|
-
import { RemoteStreamType } from 'agora-rtc-sdk-ng';
|
|
12
11
|
import { Logger } from '../../../logger';
|
|
12
|
+
import { AgoraRteAudioRawDataConfig, AgoraRteAudioRawDataObserver, AgoraRteAudioRawDataPosition } from '../../../media/type';
|
|
13
13
|
declare global {
|
|
14
14
|
interface Window {
|
|
15
15
|
main_pid: string;
|
|
@@ -71,12 +71,11 @@ export declare class RtcAdapterElectron extends RtcAdapterBase {
|
|
|
71
71
|
onLocalAudioTrackStateChanged(cb: LocalAudioTrackStateEvent): number;
|
|
72
72
|
onLocalAudioVolume(cb: (volume: number) => void): number;
|
|
73
73
|
onLocalScreenShareTrackStateChanged(cb: LocalVideoTrackStateEvent): number;
|
|
74
|
-
onAudioFrame(cb: (buffer: ArrayBuffer) => void): number;
|
|
75
74
|
setBeautyEffectOptions(enable: boolean, options: AGBeautyEffect): number;
|
|
76
|
-
setAudioFrameCallback(): number;
|
|
77
|
-
stopAudioFrameCallback(): number;
|
|
78
|
-
setAudioRawDataConfig(config: AGAudioRawDataConfig): number;
|
|
79
75
|
hasScreenSharePermission(): boolean;
|
|
76
|
+
setAudioRawDataConfig(config: AgoraRteAudioRawDataConfig, position: AgoraRteAudioRawDataPosition): number;
|
|
77
|
+
addAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver): number;
|
|
78
|
+
removeAudioRawDataObserver(observer: AgoraRteAudioRawDataObserver): number;
|
|
80
79
|
takeSnapshot(channel: string, streamUuid: number, filePath: string): Promise<AGSnapshotInfo>;
|
|
81
80
|
getCurrentFrameData(_channelName: string, _streamUuid: string, _isLocal: boolean): ImageData;
|
|
82
81
|
addCameraProcessors(_processors: unknown[]): number;
|
|
@@ -108,7 +107,7 @@ export declare class RtcChannelAdapterElectron extends RtcChannelAdapterBase {
|
|
|
108
107
|
enableDualStream(enable: boolean): Promise<void>;
|
|
109
108
|
setLowStreamParameter(streamParameter: AGLowStreamParameter): number;
|
|
110
109
|
getCurrentFrameData(_streamUuid: string): ImageData;
|
|
111
|
-
setRemoteVideoStreamType(streamUuid: string, streamType:
|
|
110
|
+
setRemoteVideoStreamType(streamUuid: string, streamType: AGRemoteVideoStreamType): Promise<void>;
|
|
112
111
|
onConnectionStateChanged(cb: (state: AGRtcState, connectionType: AGRtcConnectionType) => void): number;
|
|
113
112
|
leave(connectionType?: AGRtcConnectionType): Promise<void>;
|
|
114
113
|
onNetworkStats(cb: (stats: AGNetworkStats) => void): number;
|
|
@@ -141,6 +141,10 @@ var RtcAdapterElectron = (_dec = _log.Log.attach({
|
|
|
141
141
|
_logger.Logger.warn("no log path found, sdk logs will be put in default folder");
|
|
142
142
|
res = _this.rtcEngine.initialize(_configs.AgoraRteEngineConfig.shared.appId, _this._region);
|
|
143
143
|
}
|
|
144
|
+
var defaultRemoteVideoStreamType = _configs.AgoraRteEngineConfig.shared.rtcConfigs.defaultRemoteVideoStreamType;
|
|
145
|
+
if (typeof defaultRemoteVideoStreamType !== 'undefined') {
|
|
146
|
+
_this.rtcEngine.setRemoteDefaultVideoStreamType(defaultRemoteVideoStreamType);
|
|
147
|
+
}
|
|
144
148
|
_this.rtcEngine.registerMediaMetadataObserver();
|
|
145
149
|
if (res !== 0) {
|
|
146
150
|
_error.RteErrorCenter.shared.handleThrowableError(_error.AGRteErrorCode.RTC_ERR_RTC_ENGINE_INITIALZIE_FAILED, new Error("rtc engine initialize failed ".concat(res)));
|
|
@@ -385,35 +389,11 @@ var RtcAdapterElectron = (_dec = _log.Log.attach({
|
|
|
385
389
|
this._screenEventBus.on(_control.AgoraMediaControlEventType.trackStateChanged, cb);
|
|
386
390
|
return 0;
|
|
387
391
|
}
|
|
388
|
-
}, {
|
|
389
|
-
key: "onAudioFrame",
|
|
390
|
-
value: function onAudioFrame(cb) {
|
|
391
|
-
this.logger.warn("electron platform does not support this for now");
|
|
392
|
-
return 0;
|
|
393
|
-
}
|
|
394
392
|
}, {
|
|
395
393
|
key: "setBeautyEffectOptions",
|
|
396
394
|
value: function setBeautyEffectOptions(enable, options) {
|
|
397
395
|
return this.rtcEngine.setBeautyEffectOptions(enable, options);
|
|
398
396
|
}
|
|
399
|
-
}, {
|
|
400
|
-
key: "setAudioFrameCallback",
|
|
401
|
-
value: function setAudioFrameCallback() {
|
|
402
|
-
this.logger.warn("electron platform does not support this for now");
|
|
403
|
-
return 0;
|
|
404
|
-
}
|
|
405
|
-
}, {
|
|
406
|
-
key: "stopAudioFrameCallback",
|
|
407
|
-
value: function stopAudioFrameCallback() {
|
|
408
|
-
this.logger.warn("electron platform does not support this for now");
|
|
409
|
-
return 0;
|
|
410
|
-
}
|
|
411
|
-
}, {
|
|
412
|
-
key: "setAudioRawDataConfig",
|
|
413
|
-
value: function setAudioRawDataConfig(config) {
|
|
414
|
-
this.logger.warn("electron platform does not support this for now");
|
|
415
|
-
return 0;
|
|
416
|
-
}
|
|
417
397
|
}, {
|
|
418
398
|
key: "hasScreenSharePermission",
|
|
419
399
|
value: function hasScreenSharePermission() {
|
|
@@ -423,6 +403,24 @@ var RtcAdapterElectron = (_dec = _log.Log.attach({
|
|
|
423
403
|
}
|
|
424
404
|
return true;
|
|
425
405
|
}
|
|
406
|
+
}, {
|
|
407
|
+
key: "setAudioRawDataConfig",
|
|
408
|
+
value: function setAudioRawDataConfig(config, position) {
|
|
409
|
+
this.logger.warn("electron platform does not support setAudioRawDataConfig for now");
|
|
410
|
+
return 1;
|
|
411
|
+
}
|
|
412
|
+
}, {
|
|
413
|
+
key: "addAudioRawDataObserver",
|
|
414
|
+
value: function addAudioRawDataObserver(observer) {
|
|
415
|
+
this.logger.warn("electron platform does not support addAudioRawDataObserver for now");
|
|
416
|
+
return 1;
|
|
417
|
+
}
|
|
418
|
+
}, {
|
|
419
|
+
key: "removeAudioRawDataObserver",
|
|
420
|
+
value: function removeAudioRawDataObserver(observer) {
|
|
421
|
+
this.logger.warn("electron platform does not support removeAudioRawDataObserver for now");
|
|
422
|
+
return 1;
|
|
423
|
+
}
|
|
426
424
|
}, {
|
|
427
425
|
key: "takeSnapshot",
|
|
428
426
|
value: function takeSnapshot(channel, streamUuid, filePath) {
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
-
import { IAgoraRTCClient, IAgoraRTCRemoteUser
|
|
1
|
+
import { IAgoraRTCClient, IAgoraRTCRemoteUser } from 'agora-rtc-sdk-ng';
|
|
2
2
|
import { RtcAdapterWeb, RtcAdapterWebConfig } from '.';
|
|
3
3
|
import { AGEventEmitter } from '../../../utils/events';
|
|
4
4
|
import { RtcAdapterBase } from '../base';
|
|
5
5
|
import { AgoraRteSubscribeThread } from './thread';
|
|
6
|
-
import { AGLowStreamParameter, AGRtcState } from '../../type';
|
|
6
|
+
import { AGLowStreamParameter, AGRemoteVideoStreamType, AGRtcState } from '../../type';
|
|
7
7
|
import { AGRtcConnectionType } from '../../channel';
|
|
8
8
|
import { AgoraLatencyLevel } from '../../../../configs';
|
|
9
9
|
import { Logger } from '../../../logger';
|
|
10
|
+
import { AGAudioRawDataDispatcher } from './dispatcher';
|
|
10
11
|
export declare class AgoraRteWebClientBase extends AGEventEmitter {
|
|
11
12
|
logger: Logger;
|
|
12
13
|
protected _client: IAgoraRTCClient;
|
|
13
14
|
private _base;
|
|
14
15
|
get base(): RtcAdapterWeb;
|
|
15
16
|
private readonly configs;
|
|
16
|
-
private _connectionState;
|
|
17
17
|
protected readonly channelName: string;
|
|
18
|
-
readonly connectionType: AGRtcConnectionType;
|
|
18
|
+
protected readonly connectionType: AGRtcConnectionType;
|
|
19
|
+
protected readonly _audioRawDataDispatcher: AGAudioRawDataDispatcher;
|
|
20
|
+
private _connectionState;
|
|
19
21
|
private _networkStats;
|
|
20
22
|
private _recentLocalPacketStats;
|
|
21
23
|
private _recentRemotePacketStats;
|
|
22
|
-
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType);
|
|
24
|
+
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType, audioRawDataDispatcher: AGAudioRawDataDispatcher);
|
|
23
25
|
private _setPrivateParameter;
|
|
24
26
|
private _getRecentPacketLoss;
|
|
25
27
|
get ready(): boolean;
|
|
@@ -41,7 +43,7 @@ export declare class AgoraRteWebClientMain extends AgoraRteWebClientBase {
|
|
|
41
43
|
private _subscribeVideoThreads;
|
|
42
44
|
private _subscribeAudioThreads;
|
|
43
45
|
videoSubscribeThread(streamUuid: string): AgoraRteSubscribeThread | undefined;
|
|
44
|
-
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType);
|
|
46
|
+
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType, audioRawDataDispatcher: AGAudioRawDataDispatcher);
|
|
45
47
|
get remoteRtcUsers(): Map<string, IAgoraRTCRemoteUser>;
|
|
46
48
|
private _notifyStreamVolumes;
|
|
47
49
|
private _notifySubscribeThreads;
|
|
@@ -54,17 +56,17 @@ export declare class AgoraRteWebClientMain extends AgoraRteWebClientBase {
|
|
|
54
56
|
muteRemoteVideoMass(streamUuids: string[], mute: boolean): Promise<string[]>;
|
|
55
57
|
enableDualStream(enable: boolean): Promise<void>;
|
|
56
58
|
setLowStreamParameter(streamParameter: AGLowStreamParameter): number;
|
|
57
|
-
setRemoteVideoStreamType(streamUuid: string, streamType:
|
|
59
|
+
setRemoteVideoStreamType(streamUuid: string, streamType: AGRemoteVideoStreamType): Promise<void>;
|
|
58
60
|
leave(): Promise<void>;
|
|
59
61
|
}
|
|
60
62
|
export declare class AgoraRteWebClientSub extends AgoraRteWebClientBase {
|
|
61
63
|
private _publishThread;
|
|
62
|
-
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType);
|
|
64
|
+
constructor(channelName: string, configs: RtcAdapterWebConfig, base: RtcAdapterBase, connectionType: AGRtcConnectionType, audioRawDataDispatcher: AGAudioRawDataDispatcher);
|
|
63
65
|
muteLocalVideo(mute: boolean): number;
|
|
64
66
|
muteLocalAudio(mute: boolean): number;
|
|
65
67
|
muteLocalScreenShare(mute: boolean): number;
|
|
66
68
|
setLowStreamParameter(streamParameter: AGLowStreamParameter): number;
|
|
67
|
-
setRemoteVideoStreamType(streamUuid: string, streamType:
|
|
69
|
+
setRemoteVideoStreamType(streamUuid: string, streamType: AGRemoteVideoStreamType): Promise<void>;
|
|
68
70
|
enableDualStream(enable: boolean): Promise<void>;
|
|
69
71
|
protected setConnectionState(state: AGRtcState): void;
|
|
70
72
|
leave(): Promise<void>;
|