@4players/odin-common 3.0.0 → 3.2.0
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/plugin/api.d.ts +10 -7
- package/package.json +1 -1
package/lib/plugin/api.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ export declare namespace Backend {
|
|
|
10
10
|
}
|
|
11
11
|
interface Plugin {
|
|
12
12
|
readonly version: Version;
|
|
13
|
-
readonly playbackVolume:
|
|
13
|
+
readonly playbackVolume: PlaybackVolume;
|
|
14
14
|
readonly supportedTransports: (Transport.WebRTC | Transport.H3)[];
|
|
15
15
|
joinRoom(parameters: JoinRoomParameters): Room;
|
|
16
16
|
createAudioPlayback(parameters: CreateAudioPlaybackParameters): Promise<AudioPlayback>;
|
|
@@ -18,7 +18,7 @@ export declare namespace Backend {
|
|
|
18
18
|
createVideoCapture(ms: MediaStream, options?: VideoInputOptions): Promise<VideoCapture>;
|
|
19
19
|
createVideoPlayback(parameters: CreateVideoPlaybackParameters): Promise<VideoPlayback>;
|
|
20
20
|
enumerateDevices(): Promise<Array<Device>>;
|
|
21
|
-
setOutputVolume(volume:
|
|
21
|
+
setOutputVolume(volume: PlaybackVolume): void;
|
|
22
22
|
setOutputDevice(device: DeviceParameters): Promise<void>;
|
|
23
23
|
close(): void;
|
|
24
24
|
}
|
|
@@ -77,13 +77,11 @@ export declare namespace Backend {
|
|
|
77
77
|
close(): void;
|
|
78
78
|
}
|
|
79
79
|
interface AudioMedia extends Media {
|
|
80
|
-
readonly volume: Volume;
|
|
81
80
|
readonly activity: Activity;
|
|
82
|
-
setVolume(value: Volume): Promise<void>;
|
|
83
81
|
}
|
|
84
82
|
interface CreateAudioPlaybackParameters {
|
|
85
83
|
readonly uid: UID;
|
|
86
|
-
readonly volume?:
|
|
84
|
+
readonly volume?: PlaybackVolume;
|
|
87
85
|
readonly customType?: string;
|
|
88
86
|
}
|
|
89
87
|
interface CreateVideoPlaybackParameters {
|
|
@@ -91,20 +89,24 @@ export declare namespace Backend {
|
|
|
91
89
|
readonly customType?: string;
|
|
92
90
|
}
|
|
93
91
|
interface AudioPlayback extends AudioMedia {
|
|
92
|
+
readonly volume: PlaybackVolume;
|
|
94
93
|
readonly uid: UID;
|
|
95
94
|
jitterStats: JitterStats;
|
|
95
|
+
setVolume(value: PlaybackVolume): Promise<void>;
|
|
96
96
|
}
|
|
97
97
|
interface CreateAudioCaptureParameters extends Partial<DeviceParameters> {
|
|
98
|
-
readonly volume?:
|
|
98
|
+
readonly volume?: CaptureVolume;
|
|
99
99
|
readonly vad?: VadConfig;
|
|
100
100
|
readonly apm?: ApmConfig;
|
|
101
101
|
}
|
|
102
102
|
interface AudioCapture extends AudioMedia {
|
|
103
|
+
readonly volume: CaptureVolume;
|
|
103
104
|
readonly vad?: VadConfig;
|
|
104
105
|
readonly apm?: ApmConfig;
|
|
105
106
|
setVad(config: VadConfig): void;
|
|
106
107
|
setApm(config: ApmConfig): Promise<void>;
|
|
107
108
|
setDevice(device: DeviceParameters): Promise<void>;
|
|
109
|
+
setVolume(value: CaptureVolume): Promise<void>;
|
|
108
110
|
}
|
|
109
111
|
interface VideoCapture extends Media {
|
|
110
112
|
mediaStream?: MediaStream;
|
|
@@ -114,7 +116,8 @@ export declare namespace Backend {
|
|
|
114
116
|
readonly mediaStream?: MediaStream;
|
|
115
117
|
readonly uid: UID;
|
|
116
118
|
}
|
|
117
|
-
type
|
|
119
|
+
type PlaybackVolume = [number, number];
|
|
120
|
+
type CaptureVolume = 'muted' | number;
|
|
118
121
|
interface VadConfig {
|
|
119
122
|
voiceActivity?: SensitivityRange;
|
|
120
123
|
volumeGate?: SensitivityRange;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4players/odin-common",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.2.0",
|
|
4
4
|
"description": "A collection of commonly used type definitions and utility functions across ODIN web projects",
|
|
5
5
|
"author": "Josho Bleicker <josho.bleicker@4players.io> (https://www.4players.io)",
|
|
6
6
|
"homepage": "https://www.4players.io",
|