disable audio output switching as this is broken for now

pull/2027/head
Audric Ackermann 4 years ago
parent f871ed53df
commit b8d5a1c166
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -443,7 +443,7 @@
"endCall": "End call", "endCall": "End call",
"cameraPermissionNeededTitle": "Voice/Video Call permissions required", "cameraPermissionNeededTitle": "Voice/Video Call permissions required",
"cameraPermissionNeeded": "You can enable the 'Voice and video calls' permission in the Privacy Settings.", "cameraPermissionNeeded": "You can enable the 'Voice and video calls' permission in the Privacy Settings.",
"unableToCall": "cancel your ongoing call first", "unableToCall": "Cancel your ongoing call first",
"unableToCallTitle": "Cannot start new call", "unableToCallTitle": "Cannot start new call",
"callMissed": "Missed call from $name$", "callMissed": "Missed call from $name$",
"callMissedTitle": "Call missed", "callMissedTitle": "Call missed",

@ -71,16 +71,16 @@ export const AudioInputButton = ({
export const AudioOutputButton = ({ export const AudioOutputButton = ({
currentConnectedAudioOutputs, currentConnectedAudioOutputs,
isAudioOutputMuted, }: // isAudioOutputMuted,
hideArrowIcon = false, // hideArrowIcon = false,
}: { {
currentConnectedAudioOutputs: Array<InputItem>; currentConnectedAudioOutputs: Array<InputItem>;
isAudioOutputMuted: boolean; isAudioOutputMuted: boolean;
hideArrowIcon?: boolean; hideArrowIcon?: boolean;
}) => { }) => {
return ( return (
<> <>
<DropDownAndToggleButton {/* <DropDownAndToggleButton
iconType="volume" iconType="volume"
isMuted={isAudioOutputMuted} isMuted={isAudioOutputMuted}
onMainButtonClick={() => { onMainButtonClick={() => {
@ -90,7 +90,7 @@ export const AudioOutputButton = ({
showAudioOutputMenu(currentConnectedAudioOutputs, e); showAudioOutputMenu(currentConnectedAudioOutputs, e);
}} }}
hidePopoverArrow={hideArrowIcon} hidePopoverArrow={hideArrowIcon}
/> /> */}
<AudioOutputMenu <AudioOutputMenu
triggerId={audioOutputTriggerId} triggerId={audioOutputTriggerId}
@ -238,19 +238,19 @@ const showAudioInputMenu = (
}); });
}; };
const showAudioOutputMenu = ( // const showAudioOutputMenu = (
currentConnectedAudioOutputs: Array<any>, // currentConnectedAudioOutputs: Array<any>,
e: React.MouseEvent<HTMLDivElement> // e: React.MouseEvent<HTMLDivElement>
) => { // ) => {
if (currentConnectedAudioOutputs.length === 0) { // if (currentConnectedAudioOutputs.length === 0) {
ToastUtils.pushNoAudioOutputFound(); // ToastUtils.pushNoAudioOutputFound();
return; // return;
} // }
contextMenu.show({ // contextMenu.show({
id: audioOutputTriggerId, // id: audioOutputTriggerId,
event: e, // event: e,
}); // });
}; // };
const showVideoInputMenu = ( const showVideoInputMenu = (
currentConnectedCameras: Array<InputItem>, currentConnectedCameras: Array<InputItem>,
@ -300,22 +300,22 @@ const handleMicrophoneToggle = async (
} }
}; };
const handleSpeakerToggle = async ( // const handleSpeakerToggle = async (
currentConnectedAudioOutputs: Array<InputItem>, // currentConnectedAudioOutputs: Array<InputItem>,
isAudioOutputMuted: boolean // isAudioOutputMuted: boolean
) => { // ) => {
if (!currentConnectedAudioOutputs.length) { // if (!currentConnectedAudioOutputs.length) {
ToastUtils.pushNoAudioInputFound(); // ToastUtils.pushNoAudioInputFound();
return; // return;
} // }
if (isAudioOutputMuted) { // if (isAudioOutputMuted) {
// selects the first one // // selects the first one
await CallManager.selectAudioOutputByDeviceId(currentConnectedAudioOutputs[0].deviceId); // await CallManager.selectAudioOutputByDeviceId(currentConnectedAudioOutputs[0].deviceId);
} else { // } else {
await CallManager.selectAudioOutputByDeviceId(CallManager.DEVICE_DISABLED_DEVICE_ID); // await CallManager.selectAudioOutputByDeviceId(CallManager.DEVICE_DISABLED_DEVICE_ID);
} // }
}; // };
const StyledCallWindowControls = styled.div` const StyledCallWindowControls = styled.div`
position: absolute; position: absolute;

@ -161,7 +161,7 @@ export const InConversationCallContainer = () => {
if (currentSelectedAudioOutput === DEVICE_DISABLED_DEVICE_ID) { if (currentSelectedAudioOutput === DEVICE_DISABLED_DEVICE_ID) {
videoRefLocal.current.muted = true; videoRefLocal.current.muted = true;
} else { } else {
void videoRefLocal.current.setSinkId(currentSelectedAudioOutput); // void videoRefLocal.current.setSinkId(currentSelectedAudioOutput);
videoRefLocal.current.muted = false; videoRefLocal.current.muted = false;
} }
} }

@ -29,9 +29,6 @@ export type InputItem = { deviceId: string; label: string };
let currentCallUUID: string | undefined; let currentCallUUID: string | undefined;
// const VIDEO_WIDTH = 640;
// const VIDEO_RATIO = 16 / 9;
export type CallManagerOptionsType = { export type CallManagerOptionsType = {
localStream: MediaStream | null; localStream: MediaStream | null;
remoteStream: MediaStream | null; remoteStream: MediaStream | null;
@ -280,7 +277,6 @@ export async function selectAudioInputByDeviceId(audioInputDeviceId: string) {
export async function selectAudioOutputByDeviceId(audioOutputDeviceId: string) { export async function selectAudioOutputByDeviceId(audioOutputDeviceId: string) {
if (audioOutputDeviceId === DEVICE_DISABLED_DEVICE_ID) { if (audioOutputDeviceId === DEVICE_DISABLED_DEVICE_ID) {
selectedAudioOutputId = audioOutputDeviceId; selectedAudioOutputId = audioOutputDeviceId;
console.warn('selectedAudioOutputId', selectedAudioOutputId);
callVideoListeners(); callVideoListeners();
return; return;
@ -288,13 +284,11 @@ export async function selectAudioOutputByDeviceId(audioOutputDeviceId: string) {
if (audioOutputsList.some(m => m.deviceId === audioOutputDeviceId)) { if (audioOutputsList.some(m => m.deviceId === audioOutputDeviceId)) {
selectedAudioOutputId = audioOutputDeviceId; selectedAudioOutputId = audioOutputDeviceId;
console.warn('selectedAudioOutputId', selectedAudioOutputId);
callVideoListeners(); callVideoListeners();
} }
} }
async function handleNegotiationNeededEvent(_event: Event, recipient: string) { async function handleNegotiationNeededEvent(recipient: string) {
try { try {
makingOffer = true; makingOffer = true;
window.log.info('got handleNegotiationNeeded event. creating offer'); window.log.info('got handleNegotiationNeeded event. creating offer');
@ -573,7 +567,7 @@ function onDataChannelReceivedMessage(ev: MessageEvent<string>) {
} }
function onDataChannelOnOpen() { function onDataChannelOnOpen() {
window.log.info('onDataChannelOnOpen: sending video status'); window.log.info('onDataChannelOnOpen: sending video status');
setIsRinging(false);
sendVideoStatusViaDataChannel(); sendVideoStatusViaDataChannel();
} }
@ -593,8 +587,8 @@ function createOrGetPeerConnection(withPubkey: string, isAcceptingCall = false)
dataChannel.onopen = onDataChannelOnOpen; dataChannel.onopen = onDataChannelOnOpen;
if (!isAcceptingCall) { if (!isAcceptingCall) {
peerConnection.onnegotiationneeded = async (event: Event) => { peerConnection.onnegotiationneeded = async () => {
await handleNegotiationNeededEvent(event, withPubkey); await handleNegotiationNeededEvent(withPubkey);
}; };
} }
@ -953,7 +947,9 @@ export async function handleCallTypeIceCandidates(
window.log.info('handling callMessage ICE_CANDIDATES'); window.log.info('handling callMessage ICE_CANDIDATES');
pushCallMessageToCallCache(sender, remoteCallUUID, callMessage); pushCallMessageToCallCache(sender, remoteCallUUID, callMessage);
await addIceCandidateToExistingPeerConnection(callMessage); if (currentCallUUID && callMessage.uuid === currentCallUUID) {
await addIceCandidateToExistingPeerConnection(callMessage);
}
} }
async function addIceCandidateToExistingPeerConnection(callMessage: SignalService.CallMessage) { async function addIceCandidateToExistingPeerConnection(callMessage: SignalService.CallMessage) {

Loading…
Cancel
Save