uneeq-js 2.40.2 → 2.40.3
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 +7 -7
- package/dist/src/service/device-manager.d.ts +2 -0
- package/dist/src/service/media-handler.d.ts +1 -4
- package/dist/src/service/prom.d.ts +1 -1
- package/dist/src/service/uneeq-webrtc.d.ts +2 -0
- package/dist/src/service/voice-input-manager.d.ts +30 -0
- package/dist/src/types/MessageTypes.d.ts +8 -0
- package/dist/src/types/UneeqOptions.d.ts +5 -0
- package/dist/src/types/VoiceInputMode.d.ts +4 -0
- package/dist/src/uneeq.d.ts +7 -0
- package/dist/umd/index.js +576 -379
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import { API } from './api';
|
|
|
5
5
|
import { MediaHandler } from './media-handler';
|
|
6
6
|
import { MessagingService } from './messaging';
|
|
7
7
|
import { StreamManager } from './stream-manager';
|
|
8
|
+
import { VoiceInputManager } from './voice-input-manager';
|
|
8
9
|
export interface DeviceManagerOptions {
|
|
9
10
|
userMessages: Subject<any>;
|
|
10
11
|
session: NewSessionResponse;
|
|
@@ -14,6 +15,7 @@ export interface DeviceManagerOptions {
|
|
|
14
15
|
uneeqOptions: UneeqOptions;
|
|
15
16
|
sessionLiveHandler?: () => void;
|
|
16
17
|
streamManager: StreamManager;
|
|
18
|
+
voiceInputManager: VoiceInputManager;
|
|
17
19
|
}
|
|
18
20
|
export declare class DeviceManager {
|
|
19
21
|
options: DeviceManagerOptions;
|
|
@@ -5,14 +5,13 @@ export declare class MediaHandler {
|
|
|
5
5
|
private options;
|
|
6
6
|
private remoteVideoReady;
|
|
7
7
|
remoteStream$: BehaviorSubject<any>;
|
|
8
|
+
remoteTrack$: BehaviorSubject<any>;
|
|
8
9
|
avatarVideoElement: HTMLMediaElement;
|
|
9
10
|
localStream$: BehaviorSubject<any>;
|
|
10
11
|
publishState$: BehaviorSubject<PublishSubscribeState>;
|
|
11
12
|
localVideoElement: HTMLVideoElement;
|
|
12
13
|
publishingStream: boolean;
|
|
13
14
|
private webRTC?;
|
|
14
|
-
private audioContext;
|
|
15
|
-
private soundMeter;
|
|
16
15
|
constructor(options: DeviceManagerOptions, remoteVideoReady: () => void);
|
|
17
16
|
setEdgeNodeId(edgeNodeId: string): void;
|
|
18
17
|
unpublishVideo(): void;
|
|
@@ -24,7 +23,5 @@ export declare class MediaHandler {
|
|
|
24
23
|
gatherWebRTCStats(callback: any): void;
|
|
25
24
|
private publishVideo;
|
|
26
25
|
private performWebRTCConnection;
|
|
27
|
-
private initMicActivity;
|
|
28
26
|
private initTransparentBackground;
|
|
29
|
-
private micActivityConnected;
|
|
30
27
|
}
|
|
@@ -19,7 +19,6 @@ export declare class Prom {
|
|
|
19
19
|
prom_prefix: string;
|
|
20
20
|
registry: Registry;
|
|
21
21
|
messageTimings: any;
|
|
22
|
-
private metricsIntervalId;
|
|
23
22
|
metricsPushedCounter: Counter;
|
|
24
23
|
sessionStartTime: Histogram;
|
|
25
24
|
availabilityCheckTime: Histogram;
|
|
@@ -30,6 +29,7 @@ export declare class Prom {
|
|
|
30
29
|
webRtcFrameHeight: Histogram;
|
|
31
30
|
webRtcFrameWidth: Histogram;
|
|
32
31
|
conversationRoundTripTime: Histogram;
|
|
32
|
+
private metricsIntervalId;
|
|
33
33
|
constructor(apiUrl: string);
|
|
34
34
|
handleMessage(msg: PromMessage): void;
|
|
35
35
|
calculateConversationRtt(msg: PromMessage): number;
|
|
@@ -33,6 +33,7 @@ export declare class UneeqWebRTC {
|
|
|
33
33
|
sendDataMessage(message: string): void;
|
|
34
34
|
getStats(callback: any): any;
|
|
35
35
|
updateStreamTracks(stream: MediaStream): void;
|
|
36
|
+
private sdpTransform;
|
|
36
37
|
private onStats;
|
|
37
38
|
private enableDiagnostics;
|
|
38
39
|
private isMessageForUs;
|
|
@@ -59,6 +60,7 @@ export interface UneeqWebRTCOptions {
|
|
|
59
60
|
forceTurnServerUse?: boolean;
|
|
60
61
|
diagnostics?: boolean;
|
|
61
62
|
onAddStream?: (stream: any) => void;
|
|
63
|
+
onAddTrack?: (track: MediaStreamTrack) => void;
|
|
62
64
|
onConnect?: () => void;
|
|
63
65
|
onData?: (data: any) => void;
|
|
64
66
|
onClose?: () => void;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { Subject } from 'rxjs';
|
|
2
|
+
import { UneeqOptions } from '../types/UneeqOptions';
|
|
3
|
+
import { VoiceInputMode } from '../types/VoiceInputMode';
|
|
4
|
+
import { API } from './api';
|
|
5
|
+
export declare class VoiceInputManager {
|
|
6
|
+
private options;
|
|
7
|
+
private api;
|
|
8
|
+
private messages;
|
|
9
|
+
private enableMicrophone;
|
|
10
|
+
private readonly microphoneEngageVolume;
|
|
11
|
+
private readonly voiceActivityNotSpeakingTimeoutMS;
|
|
12
|
+
private soundMeter;
|
|
13
|
+
private audioContext;
|
|
14
|
+
private digitalHumanSpeaking;
|
|
15
|
+
private recording;
|
|
16
|
+
private silenceTimeout?;
|
|
17
|
+
constructor(options: UneeqOptions, api: API, messages: Subject<any>, enableMicrophone: (enabled: boolean) => void);
|
|
18
|
+
setVoiceInputMode(mode: VoiceInputMode | string): void;
|
|
19
|
+
startRecording(): void;
|
|
20
|
+
stopRecording(): void;
|
|
21
|
+
handleSessionEnd(): void;
|
|
22
|
+
initMicActivity(stream: MediaStream): void;
|
|
23
|
+
private audioContextNotSupported;
|
|
24
|
+
private handleAppMessages;
|
|
25
|
+
private requestNotSupportedInVoiceActivityMode;
|
|
26
|
+
private apiStartRecording;
|
|
27
|
+
private apiStopRecording;
|
|
28
|
+
private micActivityConnected;
|
|
29
|
+
private handleVoiceActivity;
|
|
30
|
+
}
|
|
@@ -19,6 +19,7 @@ export declare enum UneeqMessageType {
|
|
|
19
19
|
ServiceUnavailable = "ServiceUnavailable",
|
|
20
20
|
OnlineStatusUpdate = "OnlineStatusUpdate",
|
|
21
21
|
MicActivityNotSupported = "MicActivityNotSupported",
|
|
22
|
+
VoiceActivityInputModeNotSupported = "VoiceActivityInputModeNotSupported",
|
|
22
23
|
MicActivityError = "MicActivityError",
|
|
23
24
|
MicActivity = "MicActivity",
|
|
24
25
|
DeviceError = "DeviceError",
|
|
@@ -170,6 +171,13 @@ export declare class MicActivityNotSupportedMessage implements UneeqMessage {
|
|
|
170
171
|
uneeqMessageType: UneeqMessageType;
|
|
171
172
|
constructor();
|
|
172
173
|
}
|
|
174
|
+
/**
|
|
175
|
+
* Mic activity input mode is not supported by the users browser
|
|
176
|
+
*/
|
|
177
|
+
export declare class VoiceActivityInputModeNotSupportedMessage implements UneeqMessage {
|
|
178
|
+
uneeqMessageType: UneeqMessageType;
|
|
179
|
+
constructor();
|
|
180
|
+
}
|
|
173
181
|
/**
|
|
174
182
|
* Connection Lost
|
|
175
183
|
*/
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { VoiceInputMode } from './VoiceInputMode';
|
|
1
2
|
export interface UneeqOptions {
|
|
2
3
|
/** Server URL to connect to. */
|
|
3
4
|
url: string;
|
|
@@ -48,4 +49,8 @@ export interface UneeqOptions {
|
|
|
48
49
|
* If false, your configured background image will be displayed. Defaults to false.
|
|
49
50
|
*/
|
|
50
51
|
enableTransparentBackground?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* This option specifies what the default voice input mode will be.
|
|
54
|
+
*/
|
|
55
|
+
voiceInputMode: VoiceInputMode | string;
|
|
51
56
|
}
|
package/dist/src/uneeq.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { BehaviorSubject } from 'rxjs';
|
|
2
2
|
import 'rxjs/add/operator/filter';
|
|
3
3
|
import { UneeqOptions } from './types/types';
|
|
4
|
+
import { VoiceInputMode } from './types/VoiceInputMode';
|
|
4
5
|
export declare class Uneeq {
|
|
5
6
|
static onDataMessage: (msg: any) => void;
|
|
6
7
|
static onStatMessage: (stats: any) => void;
|
|
@@ -15,6 +16,7 @@ export declare class Uneeq {
|
|
|
15
16
|
private sessionStarted;
|
|
16
17
|
private deviceManager;
|
|
17
18
|
private messageHandler;
|
|
19
|
+
private voiceInputManager;
|
|
18
20
|
private unavailableAvatarMsgSent;
|
|
19
21
|
private readonly options;
|
|
20
22
|
private readonly messageCallback;
|
|
@@ -56,6 +58,11 @@ export declare class Uneeq {
|
|
|
56
58
|
* @param deviceId
|
|
57
59
|
*/
|
|
58
60
|
setSpeaker(deviceId: string): void;
|
|
61
|
+
/**
|
|
62
|
+
* Set the microphone input mode to be used.
|
|
63
|
+
* @param mode PUSH_TO_TALK or VOICE_ACTIVITY
|
|
64
|
+
*/
|
|
65
|
+
setVoiceInputMode(mode: VoiceInputMode): void;
|
|
59
66
|
/**
|
|
60
67
|
* Enable or disable the users microphone
|
|
61
68
|
* @param enable Defaults to true
|