0

I have this error: TypeError: undefined is not an object (evaluating 'f.getUserMedia')


CallingService.createVideoSession([218307,218308 ]).then(session => {
      this.setState({'session':session});
      // global.videoSession=session;
            CallingService.getUserMedia(session)
                .then(stream => {
         alert(stream)
          // global.localVideoStreamObtained=stream;
                    // global.userIsCalling=true;
                    CallingService.initiateCall(session);
                })
                .catch(err => {
                    alert("getUserMedia err" + err);
                });
        });

Please help me

  • { disconnect: [ [Function], [Function] ], jid: { _domain: Possible Unhandled Promise Rejection (id: 1): TypeError: undefined is not an object (evaluating 'b.enumerateDevices') http://192.168.1.34:8081/index.delta?platform=android&dev=true&minify=true – Armin Shahamati Nov 25 '19 at 21:48
  • getUserMedia errTypeError: undefined is not a function (evaluating 'e.getUserMedia') – Armin Shahamati Nov 25 '19 at 22:57

1 Answers1

1

let usersIds = [1, 2] let type = ConnectyCube.videochat.CallType.VIDEO

async startCall(usersIds, type, options = {}) {
    const session = ConnectyCube.videochat.createNewSession(
    usersIds,
    type,
    options
);
store.dispatch(setCallSession(session));

await this.setMediaDevices();

// create local stream
const stream = await this.callSession.getUserMedia(
  CallService.MEDIA_OPTIONS
);

// store streams
const streams = [{ userId: LOCAL_STREAM_USER_ID, stream: stream }];
for (uId of usersIds) {
  streams.push({ userId: uId, stream: null });
}
store.dispatch(addOrUpdateStreams(streams));

this.callSession.call({});

const userName = `${this.currentUser.first_name} ${this.currentUser.last_name}`;
const receivedNames = await getCallRecipientString(usersIds);

// report to CallKit (iOS only)
this.reportStartCall(
  this.callSession.ID,
  userName,
  receivedNames,
  "generic",
  type === "video"
);

this.playSound("outgoing");

return session;
}

async setMediaDevices() {
    const mediaDevices = await ConnectyCube.videochat.getMediaDevices();
    this.mediaDevices = mediaDevices;
}