feat(tracker-assist): 3.0.1 - fallback to audio-only mediaDevice request

This commit is contained in:
ShiKhu 2021-08-13 22:06:59 +08:00
parent b40980e85f
commit b2d9868673
5 changed files with 11 additions and 8 deletions

View file

@ -57,9 +57,7 @@ function AssistActions({ toggleChatWindow, userId, calling, peerConnectionStatus
function call() {
navigator.mediaDevices.getUserMedia({video:true, audio:true})
.then(onCallConnect).catch(error => {
onError(error)
.then(onCallConnect).catch(error => { // TODO retry only if specific error
navigator.mediaDevices.getUserMedia({audio:true})
.then(onCallConnect)
.catch(onError)

View file

@ -319,7 +319,6 @@ export default class AssistManager {
return;
}
// @ts-ignore
this.md.display(false);
this.dataConnection?.close();
this.setStatus(ConnectionStatus.Disconnected);
}, 8000); // TODO: more convenient way

View file

@ -1,6 +1,6 @@
{
"name": "@openreplay/tracker-assist",
"version": "3.0.0",
"version": "3.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -1,7 +1,7 @@
{
"name": "@openreplay/tracker-assist",
"description": "Tracker plugin for screen assistance through the WebRTC",
"version": "3.0.0",
"version": "3.0.1",
"keywords": [
"WebRTC",
"assistance",

View file

@ -116,8 +116,7 @@ export default function(opts: Partial<Options> = {}) {
const mouse = new Mouse();
let callUI;
navigator.mediaDevices.getUserMedia({video:true, audio:true})
.then(lStream => {
const onCallConnect = lStream => {
const onCallEnd = () => {
console.log("on callend", call.open)
mouse.remove();
@ -179,6 +178,13 @@ export default function(opts: Partial<Options> = {}) {
}
});
});
}
navigator.mediaDevices.getUserMedia({video:true, audio:true})
.then(onCallConnect)
.catch(e => { // TODO retry only if specific error
navigator.mediaDevices.getUserMedia({audio:true}) // in case there is no camera on device
.then(onCallConnect);
});
});
});