Не удается прочитать свойство 'getUserMedia' из неопределенного [React Native] - PullRequest
2 голосов
/ 03 мая 2020

Я создал сеанс видеочата и смог войти в чат по идентификатору и просмотреть участников. Однако, когда я пытаюсь получить локальный пользовательский поток, используя getUserMedia, он возвращает ошибку неопределенной функции

this._session = ConnectyCube.videochatconference.createNewSession();
this._session.getUserMedia({
  audio: true,
  video: { facingMode: 'user' }
})
.then(localStream => {
  console.log(localStream);
})
.catch((error) => {
  console.log(error);
});

this._session.join('xxxxxxxxxx', userCredentials.id, userCredentials.login)

Вот еще один вид моего кода тестирования

const env = Configs.connectyCube;
    const { credentials, config } = env;
    let userCredentials = {
        id: 123,
        login: 'xxxxxx',
        password: '*****',
      };
    ConnectyCube.init(credentials, config);
    ConnectyCube.createSession(userCredentials)
    .then(session => {
      ConnectyCube.chat.connect({
        userId: userCredentials.id,
        password: userCredentials.password
      });
      
      ConnectyCube.login(userCredentials)
      .then((user) => {
        console.log(user);
        const opponentsIds = users.filter(opponent => opponent.id !== userCredentials.id);
        .map(opponent => opponent.id);
        console.log(opponentsIds);
        this._session = ConnectyCube.videochatconference.createNewSession();
        this._session.getUserMedia({
            audio: true,
            video: { facingMode: 'user' }
          })
          .then(localStream => {
            console.log(localStream);
          })
          .catch((error) => {
            console.log(error);
          })
      })
      .catch((error) => {
        console.log(error);
      });
    }).catch(error => {
      console.log(error);
    });

с использованием: response-native 0.62.2 response-native-connectycube 3.0.1

1 Ответ

1 голос
/ 03 мая 2020

В документации ConnectyCube упоминается, что необходимо установить response-native-webrt c.

Пожалуйста, проверьте ниже: https://developers.connectycube.com/reactnative/videocalling-conference

...