fix(ui) - assist check for video and audio
This commit is contained in:
parent
f1fade81a3
commit
0920f17009
1 changed files with 21 additions and 13 deletions
|
|
@ -40,22 +40,30 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
|
|||
toast.info(`Call was rejected.`);
|
||||
}
|
||||
|
||||
function onError() {
|
||||
toast.error(`Something went wrong!`);
|
||||
function onError(e) {
|
||||
toast.error(e);
|
||||
}
|
||||
|
||||
function call() {
|
||||
function onCallConnect(lStream) {
|
||||
setLocalStream(lStream);
|
||||
setEndCall(() => callPeer(
|
||||
lStream,
|
||||
setIncomeStream,
|
||||
onClose.bind(null, lStream),
|
||||
onReject,
|
||||
onError
|
||||
));
|
||||
}
|
||||
|
||||
function call() {
|
||||
navigator.mediaDevices.getUserMedia({video:true, audio:true})
|
||||
.then(lStream => {
|
||||
setLocalStream(lStream);
|
||||
setEndCall(() => callPeer(
|
||||
lStream,
|
||||
setIncomeStream,
|
||||
onClose.bind(null, lStream),
|
||||
onReject,
|
||||
onError
|
||||
));
|
||||
}).catch(onError);
|
||||
.then(onCallConnect).catch(error => {
|
||||
onError(error)
|
||||
|
||||
navigator.mediaDevices.getUserMedia({audio:true})
|
||||
.then(onCallConnect)
|
||||
.catch(onError)
|
||||
});
|
||||
}
|
||||
|
||||
const inCall = calling !== CallingState.False;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue