code cleanup
This commit is contained in:
parent
e81d3c02ad
commit
44bae94701
|
@ -47,19 +47,6 @@ function connect() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Add local track to the conference and shares
|
|
||||||
* video type with other users if its video track.
|
|
||||||
* @param {JitsiLocalTrack} track local track
|
|
||||||
*/
|
|
||||||
function addTrack (track) {
|
|
||||||
room.addTrack(track);
|
|
||||||
|
|
||||||
if (track.isAudioTrack()) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Share email with other users.
|
* Share email with other users.
|
||||||
* @param {string} email new email
|
* @param {string} email new email
|
||||||
|
@ -89,6 +76,38 @@ function getDisplayName (id) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mute or unmute local audio stream if it exists.
|
||||||
|
* @param {boolean} muted if audio stream should be muted or unmuted.
|
||||||
|
*/
|
||||||
|
function muteLocalAudio (muted) {
|
||||||
|
if (!localAudio) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muted) {
|
||||||
|
localAudio.mute();
|
||||||
|
} else {
|
||||||
|
localAudio.unmute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Mute or unmute local video stream if it exists.
|
||||||
|
* @param {boolean} muted if video stream should be muted or unmuted.
|
||||||
|
*/
|
||||||
|
function muteLocalVideo (muted) {
|
||||||
|
if (!localVideo) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (muted) {
|
||||||
|
localVideo.mute();
|
||||||
|
} else {
|
||||||
|
localVideo.unmute();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class ConferenceConnector {
|
class ConferenceConnector {
|
||||||
constructor(resolve, reject) {
|
constructor(resolve, reject) {
|
||||||
this._resolve = resolve;
|
this._resolve = resolve;
|
||||||
|
@ -274,9 +293,7 @@ export default {
|
||||||
* @param mute true for mute and false for unmute.
|
* @param mute true for mute and false for unmute.
|
||||||
*/
|
*/
|
||||||
muteAudio (mute) {
|
muteAudio (mute) {
|
||||||
//FIXME: Maybe we should create method for that in the UI instead of
|
muteLocalAudio(mute);
|
||||||
//accessing directly eventEmitter????
|
|
||||||
APP.UI.eventEmitter.emit(UIEvents.AUDIO_MUTED, mute);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Simulates toolbar button click for audio mute. Used by shortcuts and API.
|
* Simulates toolbar button click for audio mute. Used by shortcuts and API.
|
||||||
|
@ -289,9 +306,7 @@ export default {
|
||||||
* @param mute true for mute and false for unmute.
|
* @param mute true for mute and false for unmute.
|
||||||
*/
|
*/
|
||||||
muteVideo (mute) {
|
muteVideo (mute) {
|
||||||
//FIXME: Maybe we should create method for that in the UI instead of
|
muteLocalVideo(mute);
|
||||||
//accessing directly eventEmitter????
|
|
||||||
APP.UI.eventEmitter.emit(UIEvents.VIDEO_MUTED, mute);
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* Simulates toolbar button click for video mute. Used by shortcuts and API.
|
* Simulates toolbar button click for video mute. Used by shortcuts and API.
|
||||||
|
@ -413,7 +428,7 @@ export default {
|
||||||
else if (track.isVideoTrack()) {
|
else if (track.isVideoTrack()) {
|
||||||
localVideo = track;
|
localVideo = track;
|
||||||
}
|
}
|
||||||
addTrack(track);
|
room.addTrack(track);
|
||||||
APP.UI.addLocalStream(track);
|
APP.UI.addLocalStream(track);
|
||||||
});
|
});
|
||||||
roomLocker = createRoomLocker(room);
|
roomLocker = createRoomLocker(room);
|
||||||
|
@ -600,16 +615,8 @@ export default {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
APP.UI.addListener(UIEvents.AUDIO_MUTED, (muted) => {
|
APP.UI.addListener(UIEvents.AUDIO_MUTED, muteLocalAudio);
|
||||||
if(!localAudio)
|
APP.UI.addListener(UIEvents.VIDEO_MUTED, muteLocalVideo);
|
||||||
return;
|
|
||||||
(muted)? localAudio.mute() : localAudio.unmute();
|
|
||||||
});
|
|
||||||
APP.UI.addListener(UIEvents.VIDEO_MUTED, (muted) => {
|
|
||||||
if(!localVideo)
|
|
||||||
return;
|
|
||||||
(muted)? localVideo.mute() : localVideo.unmute();
|
|
||||||
});
|
|
||||||
|
|
||||||
if (!interfaceConfig.filmStripOnly) {
|
if (!interfaceConfig.filmStripOnly) {
|
||||||
APP.UI.addListener(UIEvents.MESSAGE_CREATED, (message) => {
|
APP.UI.addListener(UIEvents.MESSAGE_CREATED, (message) => {
|
||||||
|
@ -826,7 +833,7 @@ export default {
|
||||||
if(localVideo)
|
if(localVideo)
|
||||||
localVideo.stop();
|
localVideo.stop();
|
||||||
localVideo = track;
|
localVideo = track;
|
||||||
addTrack(track);
|
room.addTrack(track);
|
||||||
if(!room)
|
if(!room)
|
||||||
localCallback();
|
localCallback();
|
||||||
APP.UI.addLocalStream(track);
|
APP.UI.addLocalStream(track);
|
||||||
|
|
Loading…
Reference in New Issue