1
0

Attempt to work with just audio sites

Signed-off-by: James Ketrenos <james_eikona@ketrenos.com>
This commit is contained in:
James Ketrenos 2022-03-18 17:13:52 -07:00
parent be5c23d9fc
commit 3bbff22ec2

View File

@ -397,7 +397,14 @@ const MediaAgent = ({setPeers}) => {
navigator.mozGetUserMedia || navigator.mozGetUserMedia ||
navigator.msGetUserMedia); navigator.msGetUserMedia);
return navigator.mediaDevices.getUserMedia({audio: true, video: true}) return navigator.mediaDevices
.getUserMedia({audio: true, video: true})
.catch((error) => {
console.log(`media-agent - Access granted to audio and video ` +
`failed. Trying just audio.`);
return navigator.mediaDevices
.getUserMedia({ audio: true, video: false })
})
.then((media) => { /* user accepted access to a/v */ .then((media) => { /* user accepted access to a/v */
console.log("media-agent - Access granted to audio/video"); console.log("media-agent - Access granted to audio/video");
media.getVideoTracks().forEach((track) => { media.getVideoTracks().forEach((track) => {