1
0

VideoCall.js 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. import React from 'react';
  2. import { View } from 'react-native';
  3. import JitsiMeet, { JitsiMeetView } from 'react-native-jitsi-meet';
  4. class VideoCall extends React.Component {
  5. constructor(props) {
  6. super(props);
  7. }
  8. componentDidMount() {
  9. setTimeout(() => {
  10. if (this.props.audio)
  11. JitsiMeet.audioCall(this.props.conferenceUri, this.props.userInfo);
  12. else
  13. JitsiMeet.call(this.props.conferenceUri, this.props.userInfo);
  14. }, 1000);
  15. }
  16. render() {
  17. return (
  18. <JitsiMeetView onConferenceTerminated={this.props.onConferenceTerminated} onConferenceJoined={this.props.onConferenceJoined} onConferenceWillJoin={this.props.onConferenceWillJoin} style={{ flex: 1, height: '100%', width: '100%' }} />
  19. );
  20. }
  21. }
  22. VideoCall.defaultProps = {
  23. onConferenceTerminated: () => {},
  24. onConferenceJoined: () => {},
  25. onConferenceWillJoin: () => {},
  26. userInfo: false,
  27. audio: false,
  28. };
  29. export default VideoCall;