fix(screenshare): audio screen share muted state (#8785)
* AudioMixerEffect muted state * update lib-jitsi-meet
This commit is contained in:
parent
30d0aabaca
commit
bad1bc91cf
|
@ -10265,8 +10265,8 @@
|
|||
}
|
||||
},
|
||||
"lib-jitsi-meet": {
|
||||
"version": "github:jitsi/lib-jitsi-meet#0ec072378c84206b90f0e001e34cf4d746384cc5",
|
||||
"from": "github:jitsi/lib-jitsi-meet#0ec072378c84206b90f0e001e34cf4d746384cc5",
|
||||
"version": "github:jitsi/lib-jitsi-meet#676c7a910505833810314a665ad1e825a158850c",
|
||||
"from": "github:jitsi/lib-jitsi-meet#676c7a910505833810314a665ad1e825a158850c",
|
||||
"requires": {
|
||||
"@jitsi/js-utils": "1.0.2",
|
||||
"@jitsi/sdp-interop": "1.0.3",
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
"jquery-i18next": "1.2.1",
|
||||
"js-md5": "0.6.1",
|
||||
"jwt-decode": "2.2.0",
|
||||
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#0ec072378c84206b90f0e001e34cf4d746384cc5",
|
||||
"lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#676c7a910505833810314a665ad1e825a158850c",
|
||||
"libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
|
||||
"lodash": "4.17.21",
|
||||
"moment": "2.29.1",
|
||||
|
|
|
@ -14,6 +14,16 @@ export class AudioMixerEffect {
|
|||
*/
|
||||
_mixAudio: Object;
|
||||
|
||||
/**
|
||||
* Original MediaStream from the JitsiLocalTrack that uses this effect.
|
||||
*/
|
||||
_originalStream: Object;
|
||||
|
||||
/**
|
||||
* MediaStreamTrack obtained from the original MediaStream.
|
||||
*/
|
||||
_originalTrack: Object;
|
||||
|
||||
/**
|
||||
* lib-jitsi-meet AudioMixer.
|
||||
*/
|
||||
|
@ -51,9 +61,12 @@ export class AudioMixerEffect {
|
|||
* @returns {MediaStream} - MediaStream containing both audio tracks mixed together.
|
||||
*/
|
||||
startEffect(audioStream: MediaStream) {
|
||||
this._originalStream = audioStream;
|
||||
this._originalTrack = audioStream.getTracks()[0];
|
||||
|
||||
this._audioMixer = JitsiMeetJS.createAudioMixer();
|
||||
this._audioMixer.addMediaStream(this._mixAudio.getOriginalStream());
|
||||
this._audioMixer.addMediaStream(audioStream);
|
||||
this._audioMixer.addMediaStream(this._originalStream);
|
||||
|
||||
return this._audioMixer.start();
|
||||
}
|
||||
|
@ -67,4 +80,22 @@ export class AudioMixerEffect {
|
|||
this._audioMixer.reset();
|
||||
}
|
||||
|
||||
/**
|
||||
* Change the muted state of the effect.
|
||||
*
|
||||
* @param {boolean} muted - Should effect be muted or not.
|
||||
* @returns {void}
|
||||
*/
|
||||
setMuted(muted: boolean) {
|
||||
this._originalTrack.enabled = !muted;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check wether or not this effect is muted.
|
||||
*
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isMuted() {
|
||||
return !this._originalTrack.enabled;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue