|
@@ -14,6 +14,16 @@ export class AudioMixerEffect {
|
14
|
14
|
*/
|
15
|
15
|
_mixAudio: Object;
|
16
|
16
|
|
|
17
|
+ /**
|
|
18
|
+ * Original MediaStream from the JitsiLocalTrack that uses this effect.
|
|
19
|
+ */
|
|
20
|
+ _originalStream: Object;
|
|
21
|
+
|
|
22
|
+ /**
|
|
23
|
+ * MediaStreamTrack obtained from the original MediaStream.
|
|
24
|
+ */
|
|
25
|
+ _originalTrack: Object;
|
|
26
|
+
|
17
|
27
|
/**
|
18
|
28
|
* lib-jitsi-meet AudioMixer.
|
19
|
29
|
*/
|
|
@@ -51,9 +61,12 @@ export class AudioMixerEffect {
|
51
|
61
|
* @returns {MediaStream} - MediaStream containing both audio tracks mixed together.
|
52
|
62
|
*/
|
53
|
63
|
startEffect(audioStream: MediaStream) {
|
|
64
|
+ this._originalStream = audioStream;
|
|
65
|
+ this._originalTrack = audioStream.getTracks()[0];
|
|
66
|
+
|
54
|
67
|
this._audioMixer = JitsiMeetJS.createAudioMixer();
|
55
|
68
|
this._audioMixer.addMediaStream(this._mixAudio.getOriginalStream());
|
56
|
|
- this._audioMixer.addMediaStream(audioStream);
|
|
69
|
+ this._audioMixer.addMediaStream(this._originalStream);
|
57
|
70
|
|
58
|
71
|
return this._audioMixer.start();
|
59
|
72
|
}
|
|
@@ -67,4 +80,22 @@ export class AudioMixerEffect {
|
67
|
80
|
this._audioMixer.reset();
|
68
|
81
|
}
|
69
|
82
|
|
|
83
|
+ /**
|
|
84
|
+ * Change the muted state of the effect.
|
|
85
|
+ *
|
|
86
|
+ * @param {boolean} muted - Should effect be muted or not.
|
|
87
|
+ * @returns {void}
|
|
88
|
+ */
|
|
89
|
+ setMuted(muted: boolean) {
|
|
90
|
+ this._originalTrack.enabled = !muted;
|
|
91
|
+ }
|
|
92
|
+
|
|
93
|
+ /**
|
|
94
|
+ * Check wether or not this effect is muted.
|
|
95
|
+ *
|
|
96
|
+ * @returns {boolean}
|
|
97
|
+ */
|
|
98
|
+ isMuted() {
|
|
99
|
+ return !this._originalTrack.enabled;
|
|
100
|
+ }
|
70
|
101
|
}
|