mirror of
https://github.com/balzack/databag.git
synced 2025-02-15 04:59:16 +00:00
fixing state when cant connect to media
This commit is contained in:
parent
00f4769505
commit
d6b642d6a2
@ -323,6 +323,7 @@ export function useRingContext() {
|
|||||||
videoTrack.current = false;
|
videoTrack.current = false;
|
||||||
audioTrack.current = false;
|
audioTrack.current = false;
|
||||||
accessVideo.current = false;
|
accessVideo.current = false;
|
||||||
|
try {
|
||||||
const stream = await navigator.mediaDevices.getUserMedia({
|
const stream = await navigator.mediaDevices.getUserMedia({
|
||||||
video: false,
|
video: false,
|
||||||
audio: true,
|
audio: true,
|
||||||
@ -338,6 +339,10 @@ export function useRingContext() {
|
|||||||
}
|
}
|
||||||
pc.current.addTrack(track);
|
pc.current.addTrack(track);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
catch (err) {
|
||||||
|
console.log(err);
|
||||||
|
}
|
||||||
|
|
||||||
const protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
|
const protocol = window.location.protocol === 'http:' ? 'ws://' : 'wss://';
|
||||||
ws.current = createWebsocket(`${protocol}${window.location.host}/signal`);
|
ws.current = createWebsocket(`${protocol}${window.location.host}/signal`);
|
||||||
|
Loading…
Reference in New Issue
Block a user